This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def b_insertion_sort(data) | |
stop = data.length - 1 | |
(1..stop).each do |i| | |
tmp = data[i] | |
low = 0 | |
high = i- 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def insertionSort(data) | |
len = data.length | |
(1..len-1).each do |i| | |
if data[i]>data[i-1] | |
next | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
def binaryComm(data,key): | |
stop = len(data) - 1 | |
start = 0 | |
while start <= stop: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
class Bsrecursive: | |
name = 2 | |
def BinarySearch(self,sortedArray,start,stop,key): | |
NewerOlder