algorithm-pattern-swift icon indicating copy to clipboard operation
algorithm-pattern-swift copied to clipboard

Corrections

Open jarvis-wu opened this issue 5 years ago • 0 comments

Hi there, found a couple of errata while going through the gitbook:

In line 5 of the Binary Tree > Mergesort code snippet, the condition if nums.isEmpty causes infinite loops and should be replaced with if nums.count <= 1.

In line 13 of the Binary Tree > Quicksort code snippet, the parameters of quickSort() should be &nums, start, pivot - 1 instead of &nums, 0, pivot - 1.

jarvis-wu avatar Oct 08 '20 15:10 jarvis-wu