Question
What is the worst-case time complexity of a linear
search algorithm on an array of 'N' elements?Solution
In the worst case for linear search, the target element is either at the very end of the array or not present at all. In both scenarios, the algorithm has to iterate through all 'N' elements of the array, leading to a time complexity of O(N).
- Anita bought a pair of shoes for Rs. 750, but had to sell them for Rs. 600. Find the percentage loss incurred.
Determine the value of [(sin7x - sin5x) Γ· (cos7x + cos5x)] - [(cos6x - cos4x) Γ· (sin6x + sin4x)]?
- The present ages of Priya and Tina are in the ratio 2:5, respectively. Eight years hence, the ratio of their ages will become 5:11. Find the present age of...
The angle of elevation of a tower from a certain point of bus stand is 30°. When a man walks 5m ahead in the direction of the tower, the angle of el...
The speed ratio of A to B is 4:3. C covers 840 km in 14 hours. If B's speed is 20% lower than C's speed, how much time will A need to cover 512 km?
- Suppose 6A = 8B = 15C, then find the value of (A:B:C) .
- The product of two decimals is 0.675. If one of the decimals is 2.5, then find the other decimal.
- The product of two consecutive even integers is 960. Find the product of digits of the bigger number.
Determine the co-ordinates of the point where the line through the points A (3, 4, 1) and B (5, 1, 6) crosses the XY- plane?
- A cyclist rode for 4 hours at a constant speed of 'x' km/h and then for 6 hours at a speed of (x - 10) km/h. If his average speed during the entire journey...