Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit b3f9c7c

Browse files
author
Taylor Shuler
committed
Update quick-sort.rb
1 parent 05e251b commit b3f9c7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

quick-sort/quick-sort.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# NOTE: Ruby has a built in sorting method, `sort!`, that actually uses a quick-sort process; this just demonstrates an implementation.
2+
13
def quick_sort(array) # quick sort algorithm
2-
array.sort!
4+
array.quick_sort!
35
end
46

5-
def self.sort!(array)
7+
def self.quick_sort!(array)
68
process(array, 0, array.size - 1)
79
end
810

0 commit comments

Comments
 (0)