ITEC 2620M Introduction to Data Structures - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

ITEC 2620M Introduction to Data Structures

Description:

Stacks. A stack is a 'Last-In, First-Out' = 'LIFO' buffer ... push() and pop() are the two defining functions of a stack. Example. Array-based Stacks ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 8
Provided by: mathY
Category:

less

Transcript and Presenter's Notes

Title: ITEC 2620M Introduction to Data Structures


1
ITEC 2620MIntroduction to Data Structures
  • Instructor Prof. Z. Yang
  • Course Website http//people.math.yorku.ca/zyang
    /itec2620m.htm
  • Office TEL 3049

2
Complexity Estimation recurrence relations
3
Key Points of this Lecture
  • Estimation of recursive algorithms
  • 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
Write a Comment
User Comments (0)
About PowerShow.com