push, pop
insert, delete
pop, push
delete, insert
A. push, pop
Dynamic programming
Greedy method
Divide and conquer
Backtracking
Stack
Input restricted dequeue
Priority queues
Output restricted qequeue
Best case
Null case
Worst case
Average case
P contains the address of an element in DATA.
P points to the address of first element in DATA
P can store only memory addresses
P contain the DATA and the address of DATA
Graphs
Binary tree
Stacks
Queues
O(n)
O(log n)
O(n2)
O(n log n)
Application level
Abstract level
Implementation level
All of the above
must use a sorted array
requirement of sorted array is expensive when a lot of insertion and deletions are needed
there must be a mechanism to access middle element directly
binary search algorithm is not efficient when the data elements are more than 1000.
Arrays
Records
Pointers
None
Processor and memory
Complexity and capacity
Time and space
Data and space
16
12
6
10
Last in first out
First in last out
Last in last out
First in first out
Tree
Graph
Priority
Dequeue
Operations
Algorithms
Storage Structures
None of above
Graph
Binary tree
Trees
Stack
Arrays
Linked lists
Both of above
None of above
for relatively permanent collections of data
for the size of the structure and the data in the structure are constantly changing
for both of above situation
for none of above situation
FAEKCDBHG
FAEKCDHGB
EAFKHDCBG
FEAKDCHBG
mn
max(m,n)
min(m,n)
m+n-1
array
lists
stacks
all of above
The item is somewhere in the middle of the array
The item is not in the array at all
The item is the last element in the array
The item is the last element in the array or is not there at all
Breath first search cannot be used to find converted components of a graph.
Optimal binary search tree construction can be performed efficiently using dynamic programming.
Given the prefix and post fix walks over a binary tree.The binary tree cannot be uniquely constructe
Depth first search can be used to find connected components of a graph.
Sorting
Merging
Inserting
Traversal
True, False
False, True
True, True
False, False
the name of array
the data type of array
the index set of the array
the first data from the set to be stored
The list must be sorted
there should be the direct access to the middle element in any sublist
There must be mechanism to delete and/or insert elements in list
none of above
Data
Operations
Both of the above
None of the above
Arrays
Records
Pointers
None
AVL tree
Red-black tree
Lemma tree
None of the above
Counting the maximum memory needed by the algorithm
Counting the minimum memory needed by the algorithm
Counting the average memory needed by the algorithm
Counting the maximum disk space needed by the algorithm