Coding Interview Resources
50.3K subscribers
693 photos
7 files
398 links
This channel contains the free resources and solution of coding problems which are usually asked in the interviews.

Managed by: @love_data
Download Telegram
Create and implement a data structure that provides the following operations:
- insert
- delete
- find min
- find max
- delete min
- delete max
7
Some possible solution for the problem posted above:

balanced binary search tree will provide us with all of these operations in O(log n). If some operations are more frequent, e.g. find max, min, we can use min and max heaps to make these operations in O(1). All elements are stored in linked list and heaps store pointers to nodes, so we can remove min and max in O(1) as well. Unfortunately, delete will take O(n). Please take a look at the following links for more ideas and discussion: http://www.geeksforgeeks.org/a-data-structure-question/
👍42