def ancestors
    ancestors = []
    x = parent
...

Ruby Recurrence loops

by Kartik Agaram, February 21, 2011 01:06, 3 refactorings

Is there a one-liner to rep...

14d99459914c594998d2506db1e868c2 Talk

Ruby On Stable sort in ruby

by Kartik Agaram, December 16, 2009 10:25

Yes, I know what && does, a...

14d99459914c594998d2506db1e868c2 Talk

Ruby On Stable sort in ruby

by Kartik Agaram, December 15, 2009 05:24

Beautiful and educational. ...

14d99459914c594998d2506db1e868c2 Talk

Ruby On Stable sort in ruby

by Kartik Agaram, December 14, 2009 18:42
14d99459914c594998d2506db1e868c2 Talk
class Array
  def with_indices
    n = 0
...

Ruby Stable sort in ruby

by Kartik Agaram, December 14, 2009 07:05, 7 refactorings, tagged with stable sorting

Ruby's sort isn't stable. L...

14d99459914c594998d2506db1e868c2 Talk

Lisp On Lexicographically next perm...

by Kartik Agaram, October 09, 2007 01:43

Nice!

1. How is the 'on' l...

14d99459914c594998d2506db1e868c2 Talk
; 5*O(n)
  (defun next-lex (a)
    (let* ((r (reverse a))
...

Lisp Lexicographically next perm...

by Kartik Agaram, October 04, 2007 00:19, 12 refactorings

Given a list of numbers, ge...

14d99459914c594998d2506db1e868c2 Talk

Lisp On matrix transpose

by Kartik Agaram, October 03, 2007 12:55

Nice! Totally beats what I ...

14d99459914c594998d2506db1e868c2 Talk