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 reqiredrequired
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 reqiredrequired
for _, item := range items {
fmt.Printf("Inserting '%s' into %s\n", item, sortedItems)
// lower_boundsort.Search performs the binary search using InteractiveCompareinteractiveCompare to
// rank the items
spotToInsert := sort.Search(len(sortedItems), func(i int) bool {
Anonymous user