Linked list basic questions list: Set - 1

♠ Posted by GeekyFry in ,,,, at 7:21 AM

Instead of having separate post for each question, somehow it made sense to put all the basic questions here in one question section.

  1. How do you reverse a singly linked list? How do you reverse a doubly linked list? Write a C program to do the same.
  2. Given only a pointer to a node to be deleted in a singly linked list, how do you delete it.
  3. How do you sort a linked list? Write a C program to sort a linked list.
  4. How to declare a structure of a linked list?
  5. Write a C program to implement a Generic Linked List.
  6. How do you reverse a linked list without using any C pointers?
  7. How would you detect a loop in a linked list? Write a C program to detect a loop in a linked list.
  8. How do you find the middle of a linked list? Write a C program to return the middle of a linked list.
  9. If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
  10. How to compare two linked lists? Write a C program to compare two linked lists.
  11. How to create a copy of a linked list? Write a C program to create a copy of a linked list.
  12. Write a C program to free the nodes of a linked list.
  13. Can we do a Binary search on a linked list?
  14. Write a C program to return the nth node from the end of a linked list.
  15. How would you find out if one of the pointers in a linked list is corrupted or not?
  16. Write a C program to insert nodes into a linked list in a sorted fashion.
  17. Write a C program to remove duplicates from a sorted linked list.
  18. How to read a singly linked list backwards?
  19. How can I search for data in a linked list?
  20. What is the difference between a linked list and Array?
  21. Implement a linked list. Why did you pick the method you did?
  22. Implement an algorithm to sort a linked list. Why did you pick the method you did? Now do it in O(n) time.
  23. Given two sorted linked lists, write a function to merge them into one.
  24. Delete an element from a doubly linked list.
  25. Find the nth node from the end of a singly link list in a single pass.
This should act as a checklist. I will add individual post for each of the questions and link them here.
(For responding with answers, please do mention the question no for reference here.)

0 comments:

Post a Comment