4. It is a collection of elements each identified
by at least one array index or key
An array is stored so that the position of
each element can be computed from its
index
5.
6. It is a container of objects that are inserted
and removed according to the last-in first-
out (LIFO) principle.
push
pop
9. To reverse a word. You push a given word
to stack - letter by letter - and then pop
letters from the stack.
An "undo" mechanism in text editors; this
operation is accomplished by keeping all text
changes in a stack.
10. A B C D
cD A
Letters Removed from the stack
Letter inserted into the stack
B
11. The first element is inserted from one end
called REAR.
The Deletion of existing element takes place
from the other end called as FRONT.
12. This makes queue as FIFO(First in First
Out) data structure, which means that
element inserted first will also be removed
first.
25. A doubly linked list is a list that has two
references, one to the next node and
another to previous node.
26.
27. A music player which has next and prev
buttons. –
Train, here each coach is connected to its
previous and next coach
28.
29. It is a powerful tool for organizing data
objects based on keys.
It is equally useful for organizing multiple
data objects in terms of hierarchical
relationships
33. The map will store (word, definition of word)
pairs.
• key = word
• note: words are unique
• value = definition of word
• get(word)
• returns the definition if the word is in
dictionary
• returns null if the word is not in dictionary