Data Structures and Algorithms

A quiz covering fundamental data structures including arrays, stacks, queues, trees, linked lists, and sorting algorithms.

17 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Stack is an example of

  1. static data structure
  2. complex data structure
  3. global data structure
  4. built-in data structure
  5. both (1) and (2)
Question 2 Multiple Choice (Single Answer)

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

  1. Age
  2. Sex
  3. Name of the Spouse
  4. Names of the Children
  5. Father Name
Question 3 Multiple Choice (Single Answer)

The operation accessing each record exactly once, so that certain items in the record may be processed is called

  1. Traversing
  2. Sorting
  3. Searching
  4. Merging
  5. Finding
Question 4 Multiple Choice (Single Answer)

Reverse polish notation for the expression (4 + 2 * 5) / (1 + 3 * 2) will be

  1. () + - / 425123
  2. (425132) / + -
  3. 4 2 5 * + 1 3 2 * + /
  4. 425 + - / 132
  5. None of these
Question 5 Multiple Choice (Single Answer)

What is the complexity of 'Quick sort' in the worst case?

  1. O(n2)
  2. nlogn
  3. O(n)
  4. O(nlogn)
  5. n
Question 6 Multiple Choice (Single Answer)

Which of the following algorithms does not have the same complexity for the worst case and the average case?

  1. Bubble Sort
  2. Quick Sort
  3. Heap Sort
  4. Insert Sort
  5. Selection sort
Question 7 Multiple Choice (Single Answer)

What are sparse matrices?

  1. Matrices with a relatively high proportion of zero entries
  2. Matrices with a relatively high proportion of non-zero entries
  3. Matrices with a relatively high proportion of 1's
  4. Matrices with a relatively high proportion of negative entries
  5. Matrices with all zero entries
Question 8 Multiple Choice (Single Answer)

What is the limitation of binary search?

  1. List must be unsorted
  2. Direct access to the middle element
  3. Direct access to the first element
  4. Direct access to the last element
  5. None of these
Question 9 Multiple Choice (Single Answer)

Persons standing in a line and waiting for the bus is a good example of

  1. stack
  2. queue
  3. linked list
  4. graph
  5. tree
Question 10 Multiple Choice (Single Answer)

Which of the following is not a data structure operation?

  1. Traversing
  2. Insertion
  3. Removing
  4. Searching
  5. Merging
Question 11 Multiple Choice (Single Answer)

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

  1. semi-static
  2. static
  3. semi-dynamic
  4. dynamic
  5. None of these
Question 12 Multiple Choice (Single Answer)

A header list where the last node contains a null pointer is called

  1. Zero Header List
  2. Empty Header List
  3. Header less List
  4. Grounded Header List
  5. Null Header List
Question 13 Multiple Choice (Single Answer)

Complexity of merg sort in the worst case is

  1. n
  2. nlogn
  3. O(nlogn)
  4. O(n)
  5. None of these
Question 14 Multiple Choice (Single Answer)

Which of the following is not a valid string operation?

  1. Substring
  2. Indexing
  3. Concatenate
  4. Length
  5. Join
Question 15 Multiple Choice (Single Answer)

A data structure that reflects a hierarchical relationship between various elements is called a/an

  1. Stack
  2. Queue
  3. Arrays
  4. Linked List
  5. Tree
Question 16 Multiple Choice (Single Answer)

A linear list in which elements can be added or removed at either end, but not in the middle is called

  1. Queue
  2. dqueue
  3. Linked List
  4. Stack
  5. Tree
Question 17 Multiple Choice (Single Answer)

Which of the following statements is false?

  1. In a queue, deletion takes place at the front.
  2. In a queue, insertion takes place at the rear.
  3. Queue is also called LIFO.
  4. Queue is also called FIFO.
  5. In a queue, insertion and deletion can take place at both the ends.