Function to insert a node at the beginning of a linked list
function insertAtTheBegin ( start_ref , data ) { var ptr1 = new Node ( ) ; ptr1 . data = data ; ptr1 . next = start_ref ; if ( start_ref != null ) start_ref . prev = ptr1 ; start_ref = ptr1 ; return start_ref ; }