Question
Consider a simplified backtracking approach for
generating permutations of [1, 2, 3]. If the current partial permutation is [1, 3], what is the next logical step in the backtracking process?Solution
If the current partial permutation is [1, 3], and we are trying to build a permutation of [1, 2, 3], the remaining available element is 2. The next logical step is to try adding 2 to the current partial permutation, forming [1, 3, 2]. If this forms a complete and valid permutation, it's a solution. If not, then we would backtrack from [1, 3, 2] to [1, 3], and since there are no other choices for the third position, we would then backtrack further to [1].
- A vendor priced an item 45% higher than its cost price. If he sells it at a 5% discount, what is the vendor's gain percentage?
A sold 20% more apples than B. Ratio of number of apples sold by B to number of apples sold by C is 8:9. Find the number of apples sold by A if number o...
A dishonest shopkeeper promises to sell his goods at 44% loss, but he uses 910g weight instead of 1 kg. Find his actual loss percent?Â
- Rahul bought a gadget and increased its price by 60% above the cost price. He sold it after offering a discount of 20% for Rs. 2400. What would be the sell...
- A television is sold for Rs. 34,800 after gaining 16% profit. What was its cost price?
A loss of 10(1/2)% gets converted into a profit of 11(3/5)% when the selling price is increased by Rs132.60. The cost price (in Rs) of the article is:
The marked price of a dishwasher is set 25% higher than its cost price. The seller then applies two successive discounts, first 15% and then an addition...
A shopkeeper marks his goods 40% above the cost price and then offers successive discounts of 10% and 15% on the marked price. What is his overall profi...
A shopkeeper sold a school bag at a profit of 60%. Had he sold the school bag at 20% profit he would have earned Rs.164 less. Find the cost price of the...
The profit earned by selling an article for Rs. 7,000 is 2/5th the loss incurred on selling the same article for Rs. 4,500. Find the selling price of th...