Skip to content

Instantly share code, notes, and snippets.

View RUPOJS's full-sized avatar

Rupesh Singh RUPOJS

  • Bangalore, India
View GitHub Profile
@RUPOJS
RUPOJS / hanoi.js
Last active August 29, 2015 14:27
Tower of Hanoi implementation in JavaScript using recursion
var write = function(string) {
document.write(string);
}
var i = 0;
var hanoi = function(disc,src,aux,dst) {
if (disc > 0) {
hanoi(disc - 1,src,dst,aux);
write("Move disc " + disc + " from " + src + " to " + dst + "<br />");
@RUPOJS
RUPOJS / queue.js
Last active August 29, 2015 14:26
Simple implementation of queue data structure using linked list(kind of) in javascript
function Node(data) {
this.data = data;
this.next = null;
};
function Queue() {
this.head = null;
this.tail = null;
};