Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITEC 2620M Introduction to Data Structures

Similar presentations


Presentation on theme: "ITEC 2620M Introduction to Data Structures"— Presentation transcript:

1 ITEC 2620M Introduction to Data Structures
Instructor: Prof. Z. Yang Course Website: Office: DB 3049

2 Complexity Estimation – recurrence relations

3 Key Points Estimation of recursive algorithms Basic Data Types I
How many times? What does it cost? Basic Data Types I Stacks

4 Relating Complexity Estimation to Recurrence Relations
“How many times?” is the number of recurrences – levels of recursion. “What does it cost?” is for an entire “level” of recursion. linear recursion What does this recursive call cost? binary recursion What do all recursive calls at this “level” cost?

5 Examples Factorial Binary search Mergesort Quicksort

6 Abstract Data Types A way to specify the functionality of an entity without worrying about its implementation List ADT   interface SortedList { public void insert (Object item); public object remove (); public boolean isInList (); }

7 Stacks A stack is a “Last-In, First-Out” = “LIFO” buffer.
Only the top element of a stack is accessible. When elements are added, they are pushed onto the top When elements are removed, they are popped off the top push() and pop() are the two defining functions of a stack Example Array-based Stacks


Download ppt "ITEC 2620M Introduction to Data Structures"

Similar presentations


Ads by Google