03 - Data Structure and Algorithm - Quiz
03 - Data Structure and Algorithm - Quiz
00 of 1
1. Which data structure would result in the data being sorted soon after being
inserted
Queues
Stack
Circular queue
Priority Queues
Feedback:
Priority queues have the data sorted as they are inserted into the queue
Score 1.00 of 1
2. If the elements “A”, “B”, “C” and “D” are placed in a queue one after the other
and are deleted one at a time, in what order will they be removed?
ABCD
Feedback:
Queue works on the principle " first come first serve". Hence the element (A)which enters
first will be the element that gets removed out of the queue
DCBA
DCAB
ABDC
Score 1.00 of 1
3. Binary search is used for searching an unordered list
TRUE
FALSE
Feedback:
Its a search algorithm which only works on sorted list. The algorithm makes the next
move in search assuming the list is sorted
Score 1.00 of 1
4. When working with Queue, initial values for front and rare should be
0 and 1
0 and -1
Feedback:
When queue is created for the first time without any elements, the front is initialised with
0 and rear with -1
1 and 0
0 and 0
Score 1.00 of 1
5. Which of the following data structure is non linear type ?
Strings
Lists
Stacks
Tree
Feedback:
Score 1.00 of 1
6. In linked representation of stack _____________ holds the elements of the
stack.
Info field
Feedback:
Top field
Link field
next field
Score 1.00 of 1
7. _____________ is not the operation that can be performed on stacks
Push
Pop
Display
Retrieve
Feedback:
Score 1.00 of 1
Feedback:
Score 1.00 of 1
Feedback:
A Directed tree is an acyclic graph which was one node with Indegree 0 and the rest of
the nodes has an indegree 1
Score 1.00 of 1
10. The difference between an array and a structure is
An array is suitable for homogeneous data and structures are used to store
heterogeneous data
All of above
Feedback:
Score 1.00 of 1
11. Which of the following statement is false
Arrays are dense lists and static data structure
data elements in linked list need not be stored in adjacent space in memory
Linked lists are pointers storing the next data element of a list
Feedback:
Each node in the list will have data and also pointer containing address of the next node.
linked lists are collection of the nodes that contain information part and pointer to the next
node in the list
Score 1.00 of 1
12. The term "push" and "pop" is related to
Arrays
Lists
Stacks
Feedback:
Queues
Score 1.00 of 1
13. A data structure where elements can be added or removed at either end but
not in the middle
Linked Lists
Stacks
Deque
Feedback:
Arrays
Score 1.00 of 1
14. A tree is a
Directed graph
Cyclic Graph
Feedback:
Acyclic Graph
Score 1.00 of 1
15. A normal queue, if implemented using an array of size MAX_SIZE, gets full
when
Rear=MAX_SIZE-1
Feedback:
In an array of size n, the elements occupy the index starting from 0 to n-1.If we have
Array of size MAX_SIZE, the last element position will be MAX_SIZE -1
Front=(rear+1)mod MAX_SIZE
Front=rear+1
Rear=front