0% found this document useful (0 votes)
23 views1 page

Problems+ +Linked+Lists

The document lists 10 problems related to linked lists for students Aneesh, Amruth, Pradeep, and Ravindra to solve. The problems include writing pseudocode to reverse a linked list, find the nth element from the end, determine if a linked list has a loop, merge two linked lists at a node, and find the middle element of a linked list. It also includes problems for deleting a node, dividing a linked list into even and odd numbers, adding two linked lists of digits, and determining if a linked list represents a palindrome string in linear time.

Uploaded by

sagartu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

Problems+ +Linked+Lists

The document lists 10 problems related to linked lists for students Aneesh, Amruth, Pradeep, and Ravindra to solve. The problems include writing pseudocode to reverse a linked list, find the nth element from the end, determine if a linked list has a loop, merge two linked lists at a node, and find the middle element of a linked list. It also includes problems for deleting a node, dividing a linked list into even and odd numbers, adding two linked lists of digits, and determining if a linked list represents a palindrome string in linear time.

Uploaded by

sagartu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Application Problems

Aneesh,Amruth,Pradeep,Ravindra

Section: Linked Lists

Try and solve these problems!

1. Write a pseudo code to reverse the elements of a linked list, given the pointer to the first
node?

2. Find the nth element from the end of the linked list, given the pointer to the first element of
the list?

3. How do you determine if there is a loop in a linked list? Write a pseudo code for the same?

4. If two linked lists are merged at a node, how do you determine the node?

5. How do you determine the middle element of the linked list? Write a code for the same
which returns the middle element of the linked list?

6. Same as question 6, but what if there is a loop in the list?

7. Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

8. Given a linked list having positive integers, divide it into two separate linked list containing
even and odd integers. Modify the same linked list?

9. Each digit of a number is stored in a node of a linked list, given two linked lists of any length,
write a program to add the lists?

Ex: 45321 is 4->5->3->2-1->NULL

9876543 is 9->8->7->6->5->4->3 -> NULL

So you have to find 45321+9876543=?

10. A string is represented using a linked list? How do you determine if it is a palindrome or not
in O(n)?

You might also like