Driver code
let clist = null ; clist = addToEmpty ( clist , 12 ) ; clist = addBegin ( clist , 10 ) ; clist = addBegin ( clist , 8 ) ; clist = addBegin ( clist , 6 ) ; clist = addBegin ( clist , 4 ) ; clist = addBegin ( clist , 2 ) ; document . write ( " " ) ; traverse ( clist ) ; let k = 4 ;