Anonymous user
Order by pair comparisons: Difference between revisions
m
no edit summary
(added java) |
mNo edit summary |
||
Line 123:
// Use a binary insertion sort to order the items. It should ask for
// close to the minimum number of questions
for(auto& item : items)
{
Line 330:
// Use a binary insertion sort to order the items. It should ask for
// close to the minimum number of questions
for _, item := range items {
fmt.Printf("Inserting '%s' into %s\n", item, sortedItems)
//
// rank the items
spotToInsert := sort.Search(len(sortedItems), func(i int) bool {
|