You need to implement a data structure that can quickly provide the smallest element. Which data structure will you use?

  • Array
  • Binary Search Tree
  • Hash Table
  • Linked List
To quickly find the smallest element, a Binary Search Tree (BST) is the most suitable data structure. It allows for efficient searching, insertion, and deletion of elements, making it ideal for maintaining a sorted order and finding the smallest element in O(log n) time complexity.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *