Merge pull request #59 from vzvu3k6k/fix-warnings

chore: fix warnings by `ruby -w`
This commit is contained in:
vzvu3k6k 2020-11-01 20:53:59 +09:00 committed by GitHub
commit 4c2e1d9dea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -4,8 +4,8 @@ class Array
for i in 1...self.length
return false if self[i-1] > self[i]
end
return true
end
return true
end
def bogosort
### randomly shuffles until sorted
self.shuffle! until self.sorted?

View file

@ -1,7 +1,5 @@
"""
Algorithm: Heap-Sort
Time-Complexity: O(nlogn)
"""
# Algorithm: Heap-Sort
# Time-Complexity: O(nlogn)
def heap_sort(array)
array_size = array.size
adjusted_array = [nil] + array