



















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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
In the subject of the Data Structures, the key concept and the main points, which are very important in the context of the data structures are listed below:Stacks and Queues, Stack and Heap, First-In-Last-Out Structure, Method Returns, Return Parameters, Basic Architecture, Technique, Recursion, Stack Interface, Push Operations
Typology: Slides
1 / 27
This page cannot be seen from the preview
Don't miss anything!
7/11/
1
2
-^
-^
7/11/
4
public interface Stack {
public void
push(Object x);
public void
pop();
public Object top();public boolean isEmpty();public void
clear();
7/11/
5
e d^ c b a
Push
operations:
7/11/
7/11/
8
What are some advantages and disadvantages of anarray-based representation?
a^
b
c top
7/11/
10
Behavior– add item only from the back (enqueue)– remove items only from the front (dequeue)
-^
Many Applications–
printer queue
-^
network queues
-^
common resource sharing
Queue Operations– enqueue– dequeue– clear– empty– full
7/11/
11
public interface Queue {
public void
enqueue(Object
x);
public Object dequeue();public boolean isEmpty();public void
clear();
7/11/
13
front
back
k
r^
q
c^
m
Enqueue y
operation:
7/11/
14
front
back
k
r^
q
c^
m
y
Enqueue
operation:
7/11/
7/11/
19
j^ i h g f
Enqueue
a b^ c d e
Dequeue
What happenswhen the stackon the rightbecomes empty?
7/11/