Here’s a puzzle. You have six blocks. One of them weighs more than the other. You have a scale but you can only use it twice. Find the heaviest one.
(a) Write down your process as an algorithm.
(b) What search is this like?
(a) 1. Measure two of the blocks on one side and two of the blocks on the other. If the scale balances go to 3, if not go to 2.
2. Take the two blocks from the heavier side of the scale and weigh them against each other, the heavier of the two is the heaviest block.
3. Take the two blocks you didn’t weigh, and weigh them against each other, the heavier of the two is the heaviest block.
(b) This is like binary search, where the set of things to search through is repeatedly split till an answer is found.
You might also like to view...
The default sort order in a sorted query is _________.
a. ascending b. descending c. natural d. None of the above
Page numbers can be formatted to display as all of the following EXCEPT:
A) A, B, C, ... B) I, II, III, ... C) i, ii, iii, ... D) A1, A2, A3, ...
Which argument of the MessageBox macro action determines the text in the dialog box that is created?
A. Message B. View C. Type D. Title
Drop ship is one e-commerce choice for small businesses that do not want to tie up cash in an inventory of products or incur additional expenses for order fulfillment.
Answer the following statement true (T) or false (F)