COMPUTER 2430 Object Oriented Programming and Data Structures I

Slides:



Advertisements
Similar presentations
2000 Prentice Hall, Inc. All rights reserved. 1 Capitolo 4 - Arrays Outline 4.1Introduction 4.2Arrays 4.3Declaring Arrays 4.4Examples Using Arrays 4.5Passing.
Advertisements

Final Exam Preview Chapter 4,5,6,7,8,9. Remember to evaluate CS221  Go to  Ends tonight.
Self Referential Structure. A structure may not contain a member of its own type. struct check { int item; struct check n; // Invalid };
CS2852 Week 8, Class 2 Today Tree terminology Non-Binary and Non-Search Trees Tree Traversals (Remaining slides not yet shown) Tomorrow: Quiz Implementing.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
Overview of Course Java Review 1. This Course Covers, using Java Abstract data types Design, what you want them to do (OOD) Techniques, used in implementation.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Generic lists Vassilis Athitsos. Problems With Textbook Interface? Suppose that we fix the first problem, and we can have multiple stacks. Can we have.
Final Exam Tuesday, December 22nd 2:00 - 3:50pm room 102 Warren Weaver Hall.
CS2852 Week 6, Class 2 Today Class exercise: Implementing a recursive method Binary Search Trees Tomorrow: Quiz at start of lab Implementing a recursive.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Week 15 – Monday.  What did we talk about last time?  Tries.
Final Exam Review CS 3358.
Hashing.
Planning & System installation
Data Structure By Amee Trivedi.
CSCE 3110 Data Structures & Algorithm Analysis
CSCE 3110 Data Structures & Algorithm Analysis
5.13 Recursion Recursive functions Functions that call themselves
Linked Lists & Hash Tables
COMP 53 – Week Eleven Hashtables.
Data Structure Interview Question and Answers
Midterm Review.
Data Abstraction & Problem Solving with C++
Data Structures Interview / VIVA Questions and Answers
Week 15 – Monday CS221.
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
Hashing Exercises.
Efficiency add remove find unsorted array O(1) O(n) sorted array
Review for Midterm Neil Tang 03/04/2010
ECET 370 HELPS Education Your Life-- ecet370helps.com.
ECET 370 Lessons in Excellence-- ecet370.com. ECET 370 Entire Course (Devry) For more course tutorials visit ECET 370 Week 1 Lab 1 ECET.
ECET 370 HELPS Lessons in Excellence- -ecet370helps.com.
ECET 370 HELPS Education for Service- - ecet370helps.com.
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
structures and their relationships." - Linus Torvalds
Hash table another data structure for implementing a map or a set
Chapter 15 Lists Objectives
structures and their relationships." - Linus Torvalds
A Data Structure Bestiary
CSE 1342 Programming Concepts
searching Concept: Linear search Binary search
Hash Tables and Associative Containers
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
COMPUTER 2430 Object Oriented Programming and Data Structures I
Introduction to Computer Science for Majors II
Implementing Hash and AVL
COMPUTER 2430 Object Oriented Programming and Data Structures I
UNIT – V PART - I Searching By B VENKATESWARLU, CSE Dept.
Review & Lab assignments
COMPUTER 2430 Object Oriented Programming and Data Structures I
CS202 - Fundamental Structures of Computer Science II
COMPUTER 2430 Object Oriented Programming and Data Structures I
COMPUTER 2430 Object Oriented Programming and Data Structures I
CS 2430 Object Oriented Programming and Data Structures I
Road Map CS Concepts Data Structures Java Language Java Collections
Midterm Review CSE116A,B.
EE 312 Final Exam Review.
Ch Hash Tables Array or linked list Binary search trees
CS Fall 2012, Lab 11 Haohan Zhu.
COP3530- Data Structures Introduction
CS148 Introduction to Programming II
Instructor: Dr. Michael Geiger Spring 2019 Lecture 34: Exam 3 Preview
CSCE156: Introduction to Computer Science II
structures and their relationships." - Linus Torvalds
CS 2308 Final Exam Review.
COMPUTER 2430 Object Oriented Programming and Data Structures I
Lecture 4 – Data collection List ADT
Presentation transcript:

COMPUTER 2430 Object Oriented Programming and Data Structures I

Containers Bag Set Stack Queue Sorted List . . . Array Linked List

Reference and Object Class variable is a pointer (reference) and keeps the address of an object Quiz is coming? Program due! Class Variable 3 3 3

public class Node { private Student studentInfo; private Node next; // Note the type! public Node (Student x, Node p ) studentInfo = x; next = p; } public Node (Student x ) next = null; . . . Quiz is coming? Program due! 4 4 4

Linked Lists Linked lists can have their data "scattered" all over memory list Quiz is coming? Program due! 5 5 5

CS 2630 – OOPS II Linked List Tree Recursion . . .

Quiz 6 h1(key) = key % 13 h2(key) = 1 + key % 11 Key 25 38 12 47 34 21 61 35 22 h1(key) 8 9 h2(key) 4 6 2 11 7 3 1

Linear Probe h1(key) = key % 13 ( h2(key) = 1 + key % 11 ) Key 25 38 12 47 34 21 61 35 22 h1(key) 8 9 h2(key) 4 6 2 11 7 3 1 1 2 3 4 5 6 7 8 9 10 11 12 38 35 22 47 34 21 61 25

Double Hashing h1(key) = key % 13 h2(key) = 1 + key % 11 Key 25 38 12 47 34 21 61 35 22 h1(key) 8 9 h2(key) 4 6 2 11 7 3 1 1 2 3 4 5 6 7 8 9 10 11 12 35 38 21 47 61 34 22 25

Two Formulas How Many larger(last/first) – smaller(first/last) + 1 What is the sum? (first + last) * (number of items) / 2

Quiz 6 Pass I First of J Last of J # of calls 3 4 5 . N+2 N+3 N+4 N+5 for (int I = 3; I < N + 5; I ++) for (int J = N + 5; J >= I – 2; J --) Quiz6(); The total number of times Quiz6 is called: ___________________ Pass I First of J Last of J # of calls 3 4 5 . N+2 N+3 N+4 N+5 . 1 2 3 . N N+1 N+2 N+5 N+4 N+3 . 6 5 4

Quiz 6 The total number of times Quiz6 is called: (N+5) + (N+4) + (N+3) + . . . + 6 + 5 +4 = 4 + 5 + 6 + . . . + (N+3) + (N+4) + (N+5) = (4 + (N+5)) * ((N+5) – 4 + 1) / 2 = (N+9) * (N+2) / 2 = (N2 + 11N + 18) / 2

Binary Search Code Tracing Array of integers Array of Date Array of Comparable Tracing In array Not in array Format

Quiz 6 Call ComparaTo multiple times Interface Comparable No Good! CompareTo returns an integer > 0 < 0

Test 3 Wednesday, December 12 Quiz 5 Quiz 6 LSP

Prog 6 Total Points: 35 Plan in SE Tool Punch In/Out in SE Tool

Course Outcomes Survey About the course Not the instructor