Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errata in p.255 #606

Open
jeongsoolee09 opened this issue May 11, 2021 · 0 comments
Open

Errata in p.255 #606

jeongsoolee09 opened this issue May 11, 2021 · 0 comments

Comments

@jeongsoolee09
Copy link

jeongsoolee09 commented May 11, 2021

There is a errata in the code in page 255, Listing 14.4 (In-place quicksort with a mutable array):

val pi = partition(n, r, n + (n - r) / 2)

should be:

val pi = partition(n, r, n + (r - n) / 2)

as (n - r) is negative if (n < r).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants