-
-
Notifications
You must be signed in to change notification settings - Fork 63
Added countingsort.lua #38
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
Changes from 3 commits
b77dacd
593d66b
2be6f6b
c08bc1a
a3c6be4
fbd5c22
9f471ae
39e5284
495b01c
dbf28e9
b73ddb6
b6c98e9
585cf1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,52 @@ | ||||
return function( | ||||
-- list to be sorted in-place | ||||
list, | ||||
-- key_function to map elements to integer keys, defaults to identity | ||||
key_function | ||||
) | ||||
-- Default to identity function if no key_function is provided | ||||
key_function = key_function or function(x) return x end | ||||
|
||||
-- Handle empty list case | ||||
|
-- Handle empty list case |
(If anything a useful comment would explain why not handling it early creates problems further down the line. The fact that we are handling it here early is obvious.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I am sorry for this issue.....
icemberg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- Initialize the count array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.