"linked list"
Bootstrap 3.3.0 Snippet by irinashuvalova

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2> </div> </div>
// Write a function for reversing a linked list. Do it in-place function LinkedListNode(value) { this.value = value; this.next = null; } var a = new LinkedListNode(5); var b = new LinkedListNode(1); var c = new LinkedListNode(9); var d = new LinkedListNode(13); var e = new LinkedListNode(2); a.next = b; b.next = c; c.next = d; d.next = e; function reverse(node) { if (node.next.next != null) { node.next = node.next.next; reverse(node.) } else { node.next = node; return; } }

Related: See More


Questions / Comments: