





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to data structures, focusing on abstract data types (adts) and stacks. It covers the basic concepts of adts, such as lists, stacks, and queues, and explains their implementations and operations. The document also discusses the importance of time and space complexity in data structures and provides examples of time complexity analysis for lists.
Typology: Slides
1 / 29
This page cannot be seen from the preview
Don't miss anything!






















Lists, Queues, Stacks, Arrays Binary Search Trees Graphs Tries and Suffix Trees Heaps Sorting Hashing Union-Find Lowest Common Ansectors
Lists
Insert b at position i :
Delete the item at position i :
[ a 0 a 1 a 2 a 3 … ai -1 ai ai +1 … an -2 an -1 ]
b
Retrieve the item at position i :
Lists
Insert b at position i :
Delete the item at position i :
[ a 0 a 1 a 2 a 3 … ai -1 ai ai +1 … an -2 an -1 ]
Retrieve the item at position i :
Abstract Data Types (ADT)
Stacks, Queues, Dequeues
Stacks – Implement only: Insert-Last( L , b ), Retrieve-Last( L ), Delete-Last( L ) Also known as: Push( L , b ), Top( L ), Pop( L )
Queues – Implement only:
Insert-Last( L , b ), Retrieve-First( L ), Delete-First( L )
Basic Definitions
The Data Structure “Stack”
Data Structures
Time complexity – Worst case, Big O
Time complexity – Worst case, Big O
Time complexity – constants
Lets examine the time complexity of
lists
Implementing lists using arrays
array maxlen length
array maxlen length
Implementing lists using arrays
array maxlen length (^) n
0 1 n− 1^ n
Implementing lists using arrays