Does anyone know why this code isn’t working, I tried the same code in python and it worked perfectly.
function merge(l,m,r) {
let divider = m+1
let l_cache = l
let out_list = []
for (let i = 0; i < r-l+1; i++){
if (l > m){
out_list.push(numbers[divider])
divider += 1
}else if(divider > r){
out_list.push(numbers[l])
l += 1
}else if(numbers[l] < numbers[divider]){
out_list.push(numbers[l])
l += 1
}else if(numbers[l] >= numbers[divider]){
out_list.push(numbers[divider])
divider += 1
}
}
for (let i = 0; i < out_list.length; i++){
numbers[i+l_cache] = out_list[i]
}
}
function MergeSort(l,r) {
if (l < r){
let m = Math.floor((l+r-1)/2)
MergeSort(l,m)
MergeSort(m+1,r)
merge(l,m,r)
}
}
var numbers = [42, 60, 33, 79, 15, 0, 88, 62, 27, 46]
MergeSort(0,numbers.length-1)
input = [42, 60, 33, 79, 15, 0, 88, 62, 27, 46]
output = [0, 15, 27, 33, 42, 46, 60, 46, 62 ,62]
expected output = [0, 15, 27, 33, 42, 46, 60, 62, 79, 88]
how much is prednisone 20 mg – prednisone 10 mg prices prednisone 50 mg price in india
price compare advair
advair diskus 100 50 mcg
provigil for adhd – modafinil addiction buy modafinil online
where to buy cytotec in qatar
how to get accutane – isotreti buy accutane nz
where to buy amoxicillin – gnamoxicill.com buy amoxicillin 500 mg online
cheap lasix
vardenafil prices – online apotheke vardenafil vardenafil 10 mg
stromectol tablets for humans – stromectol in canada stromectol generic name
hi!,I really like your writing very a lot! proportion we keep in touch
extra about your post on AOL? I require a specialist in this area to unravel my problem.
May be that’s you! Having a look ahead to look you. http://www.deinformedvoters.org/hydroxychloroquine
how to get cialis in australia – tadalafil over the counter canadian pharmacy sildenafil
ivermectin online pharmacy – ivermectin 12mg online order stromectol online
Hmm is anyone else having problems with the images on this
blog loading? I’m trying to determine if its a problem on my end or
if it’s the blog. Any feed-back would be greatly appreciated. http://antiibioticsland.com/Ampicillin.htm
buy accutane online cheap canada – how to get accutane uk accutane nz cost
lyrica 50 – prlyrica.com reliable canadian pharmacy reviews
antibiotic amoxicillin for sale – amoxil 500 buy amoxil
viagra tablet 150 mg – buy erection pills generic viagra united states
online cialis from canada – 20 mg tadalafil best price cialis 100 mg
ivermectin 1 – purchase stromectol ivermectin where to buy for humans
buy prednisone 10 mg – order prednisone on line prednisone 54
modafinil 200 mg – modafinil adhd provigil for sale
buy azithromycin 100mg – generic azithromycin 100mg buy zithromax
lasix for sale – buy lasix no prescription furosemide 160
clomiphene online – generic clomid 100mg clomid capsules 50mg
It’s an remarkable paragraph designed for all the online users; they will get benefit from it
I am sure. http://droga5.net/
online pharmacy canada viagra – viagra rx price ordering viagra from india
z pack treat strep throat
ventolin puff
ventolin is albuterol
fluox 20mg
Oh my goodness! Amazing article dude! Thank you
so much, However I am encountering difficulties with your RSS.
I don’t know the reason why I can’t join it. Is there anyone else having similar RSS problems?
Anybody who knows the solution can you kindly respond? Thanx!! http://herreramedical.org/ivermectin
dapoxetine price uk
what is the herbal equivalent to dapoxetine
benefits of dapoxetine
ventolin 100 mcg – buy ventolin inhaler generic ventolin
where to buy cytotec – where can i buy cytotec pills online how to get cytotec
doxycycline 100mg online – best price for doxycycline doxycycline otc
neurontin gabapentin – brand synthroid synthroid 50 mcg
tadalafil pills buy online
tadalafil brand name – cialis genuine buy tadalafil tablet 5mg
can you buy cialis over the counter in canada
where to buy vardenafil – vardenafil online prescription vardenafil non generic
accutane pills for sale – buy accutane australia buy accutane online canada
buy amoxicilin online – cvs amoxicillin price buy amoxil
amox clav augmentin
buy methylprednisolone online no rx prescription – methylprednisolone 8 mg cost price of lyrica 100 mg
buy viagra online usa – Buy pfizer viagra sildenafil paypal
viagra 4 tablets
ivermectin 0.5% brand name – stromectol price usa stromectol 3 mg
prednisone online with no prescription – prednisone 15 mg tablet deltasone 5mg cost
buy lasix overseas
ventolin tablet price – ventolin cost australia ventolin tablet price
cytotec 100 mcg – cytotec singapore pharmacy cytotec cvs
order doxycycline without prescription – where to buy doxycycline over the counter prednisolone 20 mg brand name
how to get cytotec in south africa
ivermectin price – stromectol uk buy stromectole online
cytotec for sale meetup
ivermectin 400 mg – ivermectin australia stromectol xr
best place to buy tadalafil online reviews – tadalafil professional purchase tadalafil
accutane cost – where can i get accutane cheap accutane prescription cost
buy an essay paper – academic writing blog where can i buy a research paper
buy ivermectin canada – stromectol oral solution order stromectol
sildenafil Houston – Cialis free delivery www canadianonlinepharmacy
bayer vardenafil online – generic vardenafil online what are ed drugs
plaquenil dosage for ra – plaquenil 400 mg deltasone 20 mg
fildena 150mg – buy vidalista 20 uk fildena 100
xenical pills for sale – site alli or xenical
sildenafil canada generic – viagra tablets viagra brand name
pharmacy – cialis professional 20 mg pills blog order cialis 20mg
tadalafil chewable tablet reviews – cialis uk cheap online pharmacy 365
stromectol coronavirus – ivermectin for people stromectol buy
buy cheap viagra online uk – buy viagra no prescription how much is sildenafil 20 mg
great post, very informative. I ponder why the other specialists of this sector don’t understand this.
You should continue your writing. I’m confident, you’ve a
huge readers’ base already! http://harmonyhomesltd.com/Ivermectinum-during-pregnancy.html
compare viagra prices – real viagra pharmacy prescription viagra 25mg
cheap cialis online usa – cialis online tadalafil us
stromectol 2mg online – ivermectin buy online ivermectin 6 mg tablets for humans
hollywood casino – best online casino casino online gambling
pay to do assignment – pay for assignment i need help with my research paper
prednisone 120 mg daily – prednisone 60 mg prednisone purchase
how to get accutane without prescription – buy accutane 10mg online roaccutane buy
canadian valley pharmacy el reno ok best canadian online pharmacy cialis
discount super active cialis cialis france
essay newspaper in english expository essay sample papers
essay expert canada georgetown essay questions 2013
thesis on vocabulary development 3 minute thesis competition anu
plaquenil drug – generic plaquenil valacyclovir 500mg without prescription
order sildalis without prescription – glucophage tablet order metformin online
cost ampicillin – hydroxychloroquine 200mg brand order hydroxychloroquine pill
cheap hydroxychloroquine – cheap plaquenil 200mg buy generic hydroxychloroquine 400mg
buy viagra 100mg online – female cialis pill otc cialis
acheter gГ©nГ©rique sildenafil en france – sildenafil 200mg fГјr frauen tadalafil 5mg en france
stromectol generic – modafinil for sale ivermectin 3mg otc
prednisone 10mg brand – prednisone 20mg price order prednisone 5mg online
https://cialisbusd.com/ canada generic tadalafil
accutane 10mg canada – isotretinoin for sale online cost amoxicillin 250mg
lisinopril 10mg ca – order lisinopril 2.5mg generic buy generic omeprazole 20mg
order pregabalin 75mg – buy ventolin inhalator without prescription zithromax 250mg cost
tadalafil goodrx cost of cialis
tizanidine 2mg brand – generic prozac order colchicine 0.5mg generic
prescription tadalafil online https://cialisicp.com/
generic cialis tadalafil cost tadalafil generic
tadalafil without a doctor prescription buy tadalafil
cialis tadalafil tadalafil dosage
Thank you, I have recently been searching for info about this subject for a long
time and yours is the greatest I have found out till now.
However, what about the conclusion? Are you positive concerning the supply?
cialis soft tabs cheap cialis
side effects for tadalafil canada generic tadalafil
cheap cialis cialis no prescription
discount viagra online buy viagra new york
tadalafil without a doctor prescription tadalafil order online no prescription
where to order tadalafil tablets tadalafil drug
what is tadalafil buy generic cialis online with mastercard
cheapest tadalafil cost side effects for tadalafil
buy stromectol 12 mg buy generic ivermectin online
stromectol 12 http://ivermectinuni.com/
best place to buy tadalafil online when should you take cialis buy 36 hour cialis
viagra tablet price in singapore viagra for women 2013 can you buy female viagra
female viagra buy online india where can i buy viagra tablets cheap viagra india online
viagra to buy order viagra on line sildenafil pills 50 mg
Cabgolin Levitra Oral Jelly Secnidazole
sildenafil 90mg viagra price in india online purchase price viagra
pay cialis with pay pal cialis and lisinopril cialis 20 mg price cvs