This file contains hidden or 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): | |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
#This way is the easy way to do insertion sort, but needs create a new array | |
class InsertionSort | |
def sort_out_of_place(to_sort) | |
sorted = [] | |
to_sort.each do |element| | |
for index in 0..(to_sort.length - 1) | |
sorted.insert(index, element) if to_sort[index] > element | |
end | |
end |
This file contains hidden or 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 two_way_sort data | |
first,final = 0,0 | |
temp = [] | |
temp[0] = data[0] | |
result = [] | |
len = data.length | |
for i in 1..(len-1) |
This file contains hidden or 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 shell_sort data,increment | |
len_data = data.length | |
len_increment = increment.length | |
for k in 0..(len_increment - 1) | |
for i in increment[k]..(len_data - 1) | |
tmp = data[i] | |
j = i |
This file contains hidden or 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 | |
class SortAlgorithms: | |
#direct insertion sort | |
def insertion_sort(self,data): | |
for index in range(1,len(data)): | |
for inner_index in range(0,index): | |
if data[inner_index] >= data[index]: | |
data.insert(inner_index,data[index]) | |
del(data[index+1]) |
This file contains hidden or 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
// Render Multiple URLs to image | |
var RenderUrlsToImage, arrayOfUrls, system; | |
system = require("system"); | |
var fs = require('fs'); | |
/* | |
Render given urls | |
@param array of URLs to render |
This file contains hidden or 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 | |
#coding:utf-8 | |
import urllib,urllib2,cookielib,re,sys,os,time,random | |
cj = cookielib.CookieJar() | |
str1 = 'Apple-Mon identifiant Apple' #0 | |
str2 = 'Woolworths - Customer Satisfaction Survey'#0 |
OlderNewer