Second constructed linked list is : 35 -> 1 -> 12 -> 1 -> 10 -> 34
push ( & second , 35 ) ; push ( & second , 1 ) ; push ( & second , 12 ) ; push ( & second , 1 ) ; push ( & second , 10 ) ; push ( & second , 34 ) ; if ( isPermutation ( first , second ) ) { cout << " Yes " << endl ; } else { cout << " No " << endl ; } return 0 ; }