Skip to content

Instantly share code, notes, and snippets.

View spchetan11's full-sized avatar

Chetan S P spchetan11

  • Msys Technologies Pvt Ltd
  • Bangalore
View GitHub Profile
@alexfish
alexfish / .reverse
Created April 18, 2011 23:35
Reverse an array in Ruby without .reverse
i = 0
j = array.length - 1
while i < j do
last = array[j]
first = array[i]
array[i] = last
array[j] = first