Question
You are tasked with implementing a search feature for a
large, constantly changing dataset where the order of elements doesn't matter, but fast lookups are crucial. Which data structure would be the most appropriate choice?Solution
Hash Set/Map: Offers average O(1) time complexity for lookups, insertions, and deletions, making it ideal for fast operations on dynamic datasets where order is not important. Â Â Sorted Array: Fast lookups (O(log N)) but slow insertions/deletions (O(N)). Â Â Binary Search Tree: O(log N) average for all operations, but can degrade to O(N) in worst case (unbalanced). Â Â Queue/Stack: Not designed for efficient searching.
The area of the rectangular field is 720 m² and its perimeter is 106 m. Find how much percent less the breadth of the field is compared to the length o...
There is a carpet of length 20 m. How many small pieces of carpet, each of length 4 m, can be cut out of it?
If the volumes of two cubes are in the ratio 343:64, then ratio of their edges is Â
ABCD is a cyclic quadrilateral, such that ratio of measures ∠A, ∠B and ∠C is 1 : 4 : 5, then the measure of ∠D is.
John has finished planting 1/4 th of the area of rectangular garden which is 12ft wide. When he finishes planting another 90 sq. ft of the ga...
The perimeter of a square field is 14 cm more than the perimeter of a rectangle. The length of the rectangle is 49 cm which is 350% of its width. If a s...
The area of a square is 361 cm². Find the ratio of its area to that of a rectangle whose breadth is 20% more and length 50% more than the side of the s...
If the length and breadth of a rectangle are in the ratio 4:3 and its perimeter is 28 cm, then the area of the rectangle (in cm²) is :  Â
 A path of width 3 m is made outside and around a rectangular field of perimeter 210 m. If the length of the field is 50% more than its breadth, then f...
A sphere is cut into hemisphere. One of them is used as bowl. It takes 8 bowlfuls of this to fill a conical vessel of height 12cm and radius 6cm. Then f...