In this post, we will design a Data Structure that returns the string occurring maximum and minimum times in constant time O(1). This will use a hashmap and a doubly linked list utilizing the advantages of each to solve the problem.
Table of contents:
Problem StatementNaive Approach (Using a 2D doubly linked list)Optimized approach (Using hash map and doubly-linked list)Time & Space Complexity Analysis
To attempt similar problems on Designing Data Structure, go to this list.
This is simila...
Published on November 04, 2021 09:21