Data Structures and Algorithms

test your DS and C knowledge

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following data structures is used to implement predictive text or auto complete dictionary, such as found on a mobile telephone?

  1. Bloom filter
  2. Trie
  3. Hash Map
  4. Stack
  5. None of the above
Question 2 Multiple Choice (Single Answer)

Which of the following is a characteristic of bloom filter?

  1. False positive matches are possible, but false negatives are not possible.
  2. False negative matches are possible, but false positives are not possible.
  3. Bloom filter takes large amount of space than hash table.
  4. Look ups in bloom filters are much slower than look ups in hash table.
  5. None of the above
Question 3 Multiple Choice (Single Answer)

Which of the following statements are true?

  1. Linked list has more storage over head than array, considering both are of same size.
  2. Linked list's size is fixed whereas array's size can be varied dynamically.
  3. The list elements cannot be inserted or removed from the linked list.
  1. Only 1 and 2
  2. Only 1
  3. Only 2 and 3
  4. Only 2
  5. 1, 2 and 3
Question 4 Multiple Choice (Single Answer)

Which of the following statements is/are true?

  1. The time complexity for searching an element in binary search tree is O(log n).
  2. The time complexity for searching an element in binary tree is O(n).
  3. The time complexity for searching an element in binary tree and binary search tree cannot be determined.
  1. Both 1 and 2
  2. Only 1
  3. Only 2
  4. Only 2 and 3
  5. 1, 2 and 3
Question 5 Multiple Choice (Single Answer)

Given four algorithms A, B, C, D with time complexities as follows:
A-O(n)
B-O(log log n)
C-O(log n)
D-O(1)
where n > 1
Select the option, which gives the algorithms in increasing order of their time complexities.

  1. C B A D
  2. B C D A
  3. A D B C
  4. A D C B
  5. None of these
Question 6 Multiple Choice (Single Answer)

Which of the following searching methods takes a time complexity of O(1) to search an element?

  1. Linear search
  2. Binary search
  3. Hash based search (Hashing)
  4. Tree based search
  5. None of the above
Question 7 Multiple Choice (Single Answer)

Inorder traversal of Binary Search Tree gives which of the following?

  1. Descending order of inserted elements
  2. Random order of inserted elements
  3. Ascending order of inserted elements
  4. The order in which the elements are inserted
  5. None of the above
Question 8 Multiple Choice (Single Answer)

A tree data structure has 100 nodes. What is the number of nodes in this tree having no ancestor?

  1. 50
  2. 1
  3. 0
  4. 55
  5. None of these
Question 9 Multiple Choice (Single Answer)

Last in first out property is associated with which of the following data structures?

  1. Linked list
  2. Queue
  3. Stack
  4. Tree
  5. None of these
Question 10 Multiple Choice (Single Answer)

Which of the following statements is/are true?

  1. Quick sort algorithm and bubble sort algorithm takes O(n2) in worst case.
  2. Quick sort and merge sort takes O(n2) in worst case.
  1. Only 1
  2. Only 2
  3. Both 1 and 2
  4. Neither 1 or 2
  5. None of the above
Question 11 Multiple Choice (Single Answer)

In which of the following applications is a tree data structure best used?

  1. Symbol table construction
  2. Spell checker
  3. Auto complete feature
  4. Implementing recursion
  5. None of these
Question 12 Multiple Choice (Single Answer)

Which of the following statements is/are true?
Statement 1: Data structures are solely used for visualizing the data
Statement 2: Data strcuture is programming language dependent

  1. Both statement 1 and statement 2 are true.
  2. Only statement 1 is true.
  3. Only statement 2 is true.
  4. Neither statement 1 nor statement 2 are true.
  5. None of the above
Question 13 Multiple Choice (Single Answer)

Which of the following data structures can be described as a connected graph with no cycles?

  1. Linked list
  2. Tree
  3. Queue
  4. Stack
  5. None of the above
Question 14 Multiple Choice (Single Answer)

Which of the following data structures supports insertion or deletion of elements either from the front (head) or back (tail)?

  1. Queue
  2. Stack
  3. Dequeue
  4. Hash map
  5. None of these
Question 15 Multiple Choice (Single Answer)

Which of the following is a lossless data compression algorithm?

  1. Run length encoding
  2. JPEG encoding
  3. Block truncation coding
  4. Fractal compression
  5. None of the above