Question
What is the time complexity for inserting an element
into a binary heap?Solution
Inserting an element into a binary heap involves placing it at the end and then "bubbling it up" (heapifying up) to maintain the heap property. This process takes O(log n) time, where n is the number of elements.
A man purchased a book for an amount equal to the simple interest earned on Rs. 6000 lent to a friend for 2 years at an interest rate of 4% per annum. I...
Find the original cost price of an item that A sold with a 40% profit. If the profit percentage had been numerically equal to cost price, the current pr...
An electronic item is listed at Rs. 6000. After two successive discounts, the final price paid is Rs. 4080. If the first discount is 15%, what is the pe...
Guru and Chirag are dealers of mobile. The price of mobile is Rs. 54,000. Guru gives a discount of 20% on whole, while Chirag gives a discount 22% on t...
A shopkeeper marked an article 60% above its cost price and made a profit of Rs. 192 when he sold the article after giving a discount of 30%. Find the p...
Misthan Bhandar bought 20 Box of rasgullas for Rs. 1000 each. He spent Rs. 4000 on further packing and sold 10 box of them for Rs 1500 each and the rema...
Amit marked up an article of cost price Rs. 640 by certain percent and then sold it at discount of 20%. He suffered a loss of 8% in the whole transactio...
The shopkeeper sold the earrings at the profit of 15% and the cost price of earrings is Rs.1800. He earns x% profit on bracelet costing Rs.1500. If the ...
A bought a laptop for Rs.20000. He spent 20% of the amount that he had paid for buying it for its repair. He then sold the laptop to B and earned a prof...
Cost price of a bag is Rs.750. The shopkeeper marked it 80% above the cost price and sold it after giving a discount of 20%. If the shopkeeper had sold ...