Esempio n. 1
0
/* Drier program to test above function*/
int main()
{
  /* Start with the empty list */
  struct Node* head = NULL;
 
  //create linked 35->15->4->20
  push(&head, 20);
  push(&head, 4);
  push(&head, 15);
  push(&head, 35);
  
 printNthFromLast(head,4 );
 printNthFromLast(head,3 );
 printNthFromLast(head,2 );
 printNthFromLast(head,1 );
 return 0; 
}
Esempio n. 2
0
/* Drier program to test above function*/
int main() 
{ 
  /* Start with the empty list */
  struct Node* head = NULL; 
  push(&head, 20); 
  push(&head, 4); 
  push(&head, 15); 
  push(&head, 35); 
  
  printNthFromLast(head, 4); 
}