Order by pair comparisons: Difference between revisions
Content added Content deleted
Line 880: | Line 880: | ||
print "(#{count}) Is #{item} < #{x}? " |
print "(#{count}) Is #{item} < #{x}? " |
||
gets.start_with?('y') |
gets.start_with?('y') |
||
} || sortedItems.length # if |
} || sortedItems.length # if insertion point is at the end, bsearch_index returns nil |
||
sortedItems.insert(spotToInsert, item) |
sortedItems.insert(spotToInsert, item) |
||
} |
} |