Data Structures and Algorithms Quiz
Test your knowledge of data structures including trees, graphs, queues, deques, and sorting algorithms
Questions
The complexity of merge sort algorithm is
- O(n)
- O(log n)
- O(n2)
- O(n log n)
Which of the following sorting algorithm is of divide-and-conquer type?
- Bubble sort
- Insertion sort
- Quick sort
- All of above
An algorithm that calls itself directly or indirectly is known as
- Sub algorithm
- Recursion
- Polish notation
- Traversal algorithm
In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called
- Leaf
- branch
- path
- thread
The in order traversal of tree will yield a sorted listing of elements of tree in
- Binary trees
- Binary search trees
- Heaps
- None of above
Which of the following data structure is non-linear type?
- Strings
- Lists
- Stacks
- None of above
Which of the following data structure is linear type?
- Strings
- Lists
- Queues
- All of above
The depth of a complete binary tree is given by
- Dn = n log2n
- Dn = n log2n+1
- Dn = log2n
- Dn = log2n+1
When representing any algebraic expression E which uses only binary operations in a 2-tree,
- the variable in E will appear as external nodes and operations in internal nodes
- the operations in E will appear as external nodes and variables in internal nodes
- the variables and operations in E will appear only in internal nodes
- the variables and operations in E will appear only in external nodes
A binary tree can easily be converted into q 2-tree
- by replacing each empty sub tree by a new internal node
- by inserting an internal nodes for non-empty node
- by inserting an external nodes for non-empty node
- by replacing each empty sub tree by a new external node
When converting binary tree into extended binary tree, all the original nodes in binary tree are
- internal nodes on extended tree
- external nodes on extended tree
- vanished on extended tree
- None of above
The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
- ABFCDE
- ADBFEC
- ABDECF
- ABDCEF
In a Heap tree
- Values in a node is greater than every value in left sub tree and smaller than right sub tree
- Values in a node is greater than every value in children of it
- Both of above conditions applies
- None of above conditions applies
In a graph if e=[u, v], Then u and v are called
- endpoints of e
- adjacent nodes
- neighbors
- all of above
A connected graph T without any cycles is called
- a tree graph
- free tree
- a tree
- All of above
In a graph if e=(u, v) means
- u is adjacent to v but v is not adjacent to u
- e begins at u and ends at v
- u is processor and v is successor
- both b and c
If every node u in G is adjacent to every other node v in G, A graph is said to be
- isolated
- complete
- finite
- strongly connected
Which data structure allows deleting data elements from front and inserting at rear?
- Stacks
- Queues
- Deques
- Binary search tree
Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
- Input-restricted deque
- Output-restricted deque
- Priority queues
- None of above
To represent hierarchical relationship between elements, which data structure is suitable?
- Deque
- Priority
- Tree
- All of above