## C Program for Bubble Sort on Linked List

Given a singly linked list, sort it using bubble sort. Input : 10->30->20->5 Output : 5->10->20->30 Input : 20->4->3 Output : 3->4->20 filter_none edit close… Read More »

- Create linked list from a given array
- Add Two Numbers Represented by Linked Lists | Set 3
- Introduction to Data Structures | 10 most commonly used Data Structures
- Add the given digit to a number stored in a linked list
- Print the last k nodes of the linked list in reverse order | Iterative Approaches
- Convert a given Binary Tree to Circular Doubly Linked List | Set 2
- Create new linked list from two given linked list with greater element at each node
- Bubble Sort for Linked List by Swapping nodes
- Linked List Implementation in C#
- Delete Nth node from the end of the given linked list
- Reverse a Linked List in groups of given size (Iterative Approach)
- Count duplicates in a given linked list
- Find sum of even and odd nodes in a linked list
- Iterative selection sort for linked list
- Maximum sum of K consecutive nodes in the given Linked List
- Reverse alternate K nodes in a Singly Linked List - Iterative Solution
- Program to unfold a folded linked list
- Correct the Random Pointer in Doubly Linked List
- Sum of all distinct nodes in a linked list
- Sum of nodes in a linked list which are greater than next node
- Find the balanced node in a Linked List
- Add one to a number represented as linked list | Set 2
- Insert N elements in a Linked List one after other at middle position
- Create a linked list from two linked lists by choosing max element at each position
- Divide the given linked list in two lists of size ratio p:q
- Remove Nth node from end of the Linked List
- Find the first duplicate element in the linked list
- Sum of smaller elements of nodes in a linked list
- Maximum sum contiguous nodes in the given linked list
- Check whether the sum of element of a node is equal to the given key value

Given a singly linked list, sort it using bubble sort. Input : 10->30->20->5 Output : 5->10->20->30 Input : 20->4->3 Output : 3->4->20 filter_none edit close… Read More »

Given a singly linked list, write a function to swap elements pairwise. For example, if the linked list is 1->2->3->4->5->6->7 then the function should change… Read More »

It was a very good experience to face interview at Qualcomm. I have attended the interview for a position of Embedded SW application developer and… Read More »

Given a stream of characters, find the first non-repeating character from stream. You need to tell the first non-repeating character in O(1) time at any… Read More »

Given a Binary Tree, extract all leaves of it in a Doubly Linked List (DLL). Note that the DLL need to be created in-place. Assume… Read More »

Given two linked lists, insert nodes of second list into first list at alternate positions of first list. For example, if first list is 5->7->17->13->11… Read More »

VMWare interview for MTS-2 position. I Telephonic round 1. Given an array of strings. Find the maximum prefix among all the strings. Ans: First told… Read More »

Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL). The left and right pointers in nodes are to be used as previous… Read More »

QuickSort on Doubly Linked List is discussed here. QuickSort on Singly linked list was given as an exercise. Following is C++ implementation for same. The… Read More »

Given a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes,… Read More »

Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be… Read More »

Following is a typical recursive implementation of QuickSort for arrays. The implementation uses last element as pivot. filter_none edit close play_arrow link brightness_4 code /*… Read More »

Given a Binary Tree (Bt), convert it to a Doubly Linked List(DLL). The left and right pointers in nodes are to be used as previous… Read More »

We have introduced Linked Lists in the previous post. We also created a simple linked list with 3 nodes and discussed linked list traversal. All… Read More »

Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at a contiguous location; the elements are linked… Read More »