ITEC 2620M Introduction to Data Structures

Slides:



Advertisements
Similar presentations
STACKS & QUEUES. Stacks Abstract data types An abstract data type (ADT) is an abstraction of a data structure An ADT specifies : –Data stored –Operations.
Advertisements

Stacks & Their Applications COP Stacks  A stack is a data structure that stores information arranged like a stack.  We have seen stacks before.
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
Stacks A stack is a data structure that only allows items to be inserted and removed at one end We call this end the top of the stack The other end is.
Stacks. What is a stack? Last-in first-out data structure (LIFO) New objects are placed on top Removal restricted to top object Examples?
Introduction to Stacks What is a Stack Stack implementation using arrays. Application of Stack.
Stacks.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
Introduction to Stacks What is a Stack Stack implementation using array. Stack implementation using linked list. Applications of Stack.
COMP 110 Introduction to Programming Mr. Joshua Stough.
CHAPTER 6 Stacks. 2 A stack is a linear collection whose elements are added and removed from one end The last element to be put on the stack is the first.
Data Structures: A Pseudocode Approach with C1 Chapter 3 Objectives Upon completion you will be able to Explain the design, use, and operation of a stack.
ISOM MIS 215 Module 3 – Stacks and Queues. ISOM Where are we? 2 Intro to Java, Course Java lang. basics Arrays Introduction NewbieProgrammersDevelopersProfessionalsDesigners.
Information and Computer Sciences University of Hawaii, Manoa
9-1 Abstract Data Types Abstract data type A data type whose properties (data and operations) are specified independently of any particular implementation.
ACM/JETT Workshop - August 4-5, 2005 Using Visualization Tools To Teach Data Structures and Algorithms Java applets by Dr. R. Mukundan, University of Canterbury,
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: Tel 3049.
CSC 212 – Data Structures Lecture 17: Stacks. Question of the Day Move one matchstick to produce a square.
ISOM MIS 215 Module 4 – Recursion. ISOM Where are we? 2 Intro to Java, Course Java lang. basics Arrays Introduction NewbieProgrammersDevelopersProfessionalsDesigners.
Basic Data Structures Stacks. A collection of objects Objects can be inserted into or removed from the collection at one end (top) First-in-last-out.
Lab 6 Stack ADT. OVERVIEW The stack is one example of a constrained linear data structure. In a stack, the elements are ordered from most recently added.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: Tel 3049.
STACK Data Structure
“The desire for safety stands against every great and noble enterprise.” – Tacitus Thought for the Day.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: TEL 3049.
Click to edit Master text styles Stacks Data Structure.
Lecture No.05 Data Structures Dr. Sohail Aslam.  Josephus Problem #include "CList.cpp" void main(int argc, char *argv[]) { CList list; int i, N=10, M=3;
CPS120: Introduction to Computer Science Nell Dale John Lewis Abstract Data Types.
CPS120: Introduction to Computer Science Sorting.
1 Data Structures CSCI 132, Spring 2016 Notes_ 5 Stacks.
Code: BCA302 Data Structures with C Prof.(Dr.) Monalisa Banerjee By.
Stacks and Queues. DCS – SWC 2 Stacks A stack is an abstract data structure, with some special properties: –Insertion and deletion is only allowed at.
Sections 3.4 Formal Specification
Comprehensive Introduction to OOP with Java, C. Thomas Wu Stack ADT
Sami Rollins Spring 2006 CS312 Algorithms Sami Rollins Spring 2006.
G64ADS Advanced Data Structures
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
March 27 – Course introductions; Adts; Stacks and Queues
Chapter 15 Lists Objectives
Recap: Solution of Last Lecture Activity
Data Structures and Algorithms
Stacks.
Stacks and Queues.
Stacks and Queues.
CSE 373: Data Structures and Algorithms
ITEC 2620M Introduction to Data Structures
Introduction to Data Structure
ECET 370 HELPS Education Your Life-- ecet370helps.com.
CS302 Data Structures Fall 2012.
CMSC 341 Lecture 5 Stacks, Queues
structures and their relationships." - Linus Torvalds
Abstract Data Types (ADTs)
STACK By:- Rajendra ShakyawalP.G.T. Computer Science KV-No.1, AFS, Tambaram, Chennai.
structures and their relationships." - Linus Torvalds
Data Structures and Algorithms
ITEC 2620M Introduction to Data Structures
Lecture 5 Stacks King Fahd University of Petroleum & Minerals
ITEC 2620M Introduction to Data Structures
ITEC 2620M Introduction to Data Structures
Sorting.
Data Structures and Algorithms
ITEC 2620M Introduction to Data Structures
ITEC 2620M Introduction to Data Structures
Introduction to Stacks
Abstract Data Type (ADT)
Introduction to Stacks
Chapter 12 Heap ADT © 2011 Pearson Addison-Wesley. All rights reserved.
structures and their relationships." - Linus Torvalds
Abstract Data Types Stacks CSCI 240
Abstract Data Types (ADTs)
Presentation transcript:

ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: http://people.math.yorku.ca/~zyang/itec2620m.htm Office: DB 3049

Complexity Estimation – recurrence relations

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

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?

Examples Factorial Binary search Mergesort Quicksort

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 (); … }

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