recategorized by
1,895 views
6 votes
6 votes

Consider the following four data structures: array, binary search tree, hash table, and a linked list. Which of the following options arranges them in non-decreasing order of worst case runtime for searching?

  1. Array, Binary Search Tree, Linked List, Hash Table
  2. Hash Table, Binary Search Tree, Linked List, Array
  3. Binary Search Tree, Hash Table, Array, Linked List
  4. Hash Table, Linked List, Binary Search Tree, Array


I think it will be $O(n)$ for all four of them in the worst cases: Array-unsorted, BST-skewed, Hash Table-mapped to one location only, $LL$ has $O(n)$.

recategorized by

1 Answer

Related questions

0 votes
0 votes
1 answer
1
gauravkc asked Apr 19, 2018
3,241 views
Choose the digital building blocks from the following list using which we can realize any boolean function.(A) 2-to-1 Multiplexer(B) 4-to-1 Multiplexer(C) 8-to-1 Multiple...
0 votes
0 votes
1 answer
2
Akhilesh Singla asked Apr 15, 2018
1,078 views
More than one option can be correct
0 votes
0 votes
0 answers
3
Akhilesh Singla asked Apr 15, 2018
3,116 views
More than one option can be correct
1 votes
1 votes
0 answers
4
Akhilesh Singla asked Apr 14, 2018
1,752 views
I think options A, D and E are wrong; B is true. I'm not sure about C. I think it should be true because page table is created for a process and not for its threads so pa...