Você está na página 1de 1

B.Tech II sem Data Structures using C++ Assignment No.

1 (Linked Lists)

1. Write a member function member reverse that reverse a given linked list. 2. Overload ==operator to check whether the two linked lists are equal or not. Two linked list are equal if they contain same elements in same order. 3. Write a member function that counts the total number of elements in the linked list. 4. Write a function merge that merges two sorted linked lists. 5. Write a function concat that takes two lists L1, L2 and attach contents of second list L2 at the end of first list L1. 6. Overload + operator to add the element at the end of the list. 7. Overload << operator to print a given linked list. 8. Write a function delete that deletes alternate elements from linked list starting from node 2. 9. Write a function sum that returns the sum of all the elements of a linked list. 10. Give a class definition for a Single Linked List. 11. Write a function to free all nodes of a linked list. 12. Write a function to delete nth element from the linked list. 13. Write a function to make a second copy of a list. 14. Write a function that delete from list L1 nodes whose positions are to be found in an ordered list L2. 15. What is the average number of nodes accessed in searching a particular element in an unordered list? In an ordered list? In an unordered array? In an ordered array. 16. Give the definition of a doubly linked list and write the following member functions a. Member function to delete a given element from the list b. Overload operator = to perform assignment 17. What are copy constructors? When are called? Illustrate with the help of an example? 18. Write a friend function to insert a node in the middle of a doubly linked list. 19. What are skip lists ? Why are they used ? Illustrate with the help of an example ? 20. Write a member function of doubly linked list which deletes the middle element of the list. 21. Overload the operator >> to print a circular linked list.

Você também pode gostar