void linkedListTraversal(Node* ptr) {
while (ptr != NULL) {
cout << " Element : " << ptr->data << endl;
ptr = ptr->next;
}
}
It travels across the LinkedList and prints all the elements.
class Solution { public int removeDuplicates ( int [] nums ) { // base case: return if array have no el. if ( nums...
No comments:
Post a Comment