Find Nth Node

Find Nth Node

In the given linked list find nth node. The function should return the data value in the nth node. n is input integer index. Example Time...
Swap kth node from beginning with kth node from end

Swap kth node from beginning with kth node from end

In the given linked list, swap kth node from beginning with kth node from the end. We should not swap the values,we should swap...
Swap nodes in the linked list

Swap nodes in the linked list

We are given a linked list and two key values, we need to swap these nodes. Example Time complexity : O(n) Algorithm We need to handle these cases, a....
Delete last occurrence

Delete last occurrence

In the given linked list, write a function to delete the last occurrence of a given key from the linked list. The list can...
Check if a linked list of strings form a palindrome

Check if a linked list of strings form a palindrome

Given a linked list handling string data, write a function to check whether the data forms a palindrom or not Example INPUT ba->c->d->ca->b OUTPUT The string represented in above...
Merge two sorted linked lists such that merged list is in reverse order

Merge two sorted linked lists such that merged list is in reverse order

Given two linked lists sorted in reverse order, write a function to merge them in such a way that the result list should be...
Rearrange a given linked list in-place

Rearrange a given linked list in-place

Given a singly linked list L0-> L1-> … -> Ln-1-> Ln. Rearrange the nodes in the list so that the new formed list is...
Clone a Linked List with next and random pointer

Clone a Linked List with next and random pointer

Given a doubly linked list, in which one pointer is pointing to the next node just like in a singly linked list. The second pointer...
Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some Common nodes

Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some...

Given two sorted linked lists, construct a list that contains maximum sum path from start to end. The result list may contain nodes from both...
Quick Sort on SIngly Linked List

Quick Sort on SIngly Linked List

Given a linked list, we will sort the linked list using quick sort. Example Linked List before sorting 23 ->1 ->50 ->15 ->16 ->6 Linked List after sorting 1...

Stay connected

9,233FansLike

Latest article

Multiplication of two matrices

Multiplication of two matrices

Given two matrices, this function will multiply the two matrices and prints the result. Here, necessary and sufficient condition is the number of columns...
Subtraction of two matrices

Subtraction of two matrices

Given two matrices, we will write a function that subtracts the given matrices. Example INPUT A = { {1, 4, 7, 9}, {1, 6, 7, 6}, {6, 3, 7,...
Check if two given matrices are identical

Check if two given matrices are identical

Given two matrices, we will write a function to check whether the two matrices are identical or not. That is, if all the elements...