Data Structures and Algorithms
A quiz covering fundamental data structures including arrays, stacks, queues, trees, linked lists, and sorting algorithms.
Questions
Stack is an example of
- static data structure
- complex data structure
- global data structure
- built-in data structure
- both (1) and (2)
Which of the following data items may lead to a variable length records when included as items in a record?
(a) Age
(b) Sex
(c) Name of the Spouse
(d) Names of the Children
(e) Father Name
- Age
- Sex
- Name of the Spouse
- Names of the Children
- Father Name
The operation accessing each record exactly once, so that certain items in the record may be processed is called
- Traversing
- Sorting
- Searching
- Merging
- Finding
Reverse polish notation for the expression (4 + 2 * 5) / (1 + 3 * 2) will be
- () + - / 425123
- (425132) / + -
- 4 2 5 * + 1 3 2 * + /
- 425 + - / 132
- None of these
What is the complexity of 'Quick sort' in the worst case?
- O(n2)
- nlogn
- O(n)
- O(nlogn)
- n
Which of the following algorithms does not have the same complexity for the worst case and the average case?
- Bubble Sort
- Quick Sort
- Heap Sort
- Insert Sort
- Selection sort
What are sparse matrices?
- Matrices with a relatively high proportion of zero entries
- Matrices with a relatively high proportion of non-zero entries
- Matrices with a relatively high proportion of 1's
- Matrices with a relatively high proportion of negative entries
- Matrices with all zero entries
What is the limitation of binary search?
- List must be unsorted
- Direct access to the middle element
- Direct access to the first element
- Direct access to the last element
- None of these
Persons standing in a line and waiting for the bus is a good example of
- stack
- queue
- linked list
- graph
- tree
Which of the following is not a data structure operation?
- Traversing
- Insertion
- Removing
- Searching
- Merging
A variable whose length may vary during the execution of the program as long as the length does not exceed a maximum value determined by a program before it is executed is called
- semi-static
- static
- semi-dynamic
- dynamic
- None of these
A header list where the last node contains a null pointer is called
- Zero Header List
- Empty Header List
- Header less List
- Grounded Header List
- Null Header List
Complexity of merg sort in the worst case is
- n
- nlogn
- O(nlogn)
- O(n)
- None of these
Which of the following is not a valid string operation?
- Substring
- Indexing
- Concatenate
- Length
- Join
A data structure that reflects a hierarchical relationship between various elements is called a/an
- Stack
- Queue
- Arrays
- Linked List
- Tree
A linear list in which elements can be added or removed at either end, but not in the middle is called
- Queue
- dqueue
- Linked List
- Stack
- Tree
Which of the following statements is false?
- In a queue, deletion takes place at the front.
- In a queue, insertion takes place at the rear.
- Queue is also called LIFO.
- Queue is also called FIFO.
- In a queue, insertion and deletion can take place at both the ends.