kala-here / algo-ridmz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

algo-ridmz

A collection of puzzles I play with and test. 👍

I have sourced these fun challenges from:

Definitions

Binary Search:

def binary_search(arr, num, start, end_point)
  n = arr.length
  mid = (start + end_point)/2
  while start <= end_point
    if num == arr[mid]
    	return mid
    end
    num > mid ? start = mid + 1 : end_point = mid - 1
  end
  return -1
end

Recursion Recipe:

def callMyself()
  if # base case
    return
  end
  if # recursive case
    return callMyself()
  end
  return
end

About


Languages

Language:Ruby 94.5%Language:JavaScript 5.5%