## Bubble Sort on Linked List

We have seen sorting on numbers in arrays. Now what about sorting a linked list using bubble sort? Before we continue, we must keep in mind that a list is… Read more »

- Home
- Algorithms
- Computer Graphics
- Lab 1 – Print Green Window
- Lab 2 – Sierpinski Triangle
- Lab 3 – Two Dots
- Lab 4 – Square in Square
- Lab 5 – Qaudrilateral
- LAB 6- e^(-x)*cos(2*x*π ) Graph
- Lab 7 – sin(x)/x Graph
- Lab 8 – Dot on Click
- Lab 9 – (i) Chess Board
- Lab 9 – (ii) Colored Chess Board
- Lab 10 – Freehand Drawing
- Lab 11 – Mouse Click Polyline
- Lab – 12. Color Freehand Drawing

- Data Structures
- Networking
- About Us

Man is still the most extraordinary computer of all

We have seen sorting on numbers in arrays. Now what about sorting a linked list using bubble sort? Before we continue, we must keep in mind that a list is… Read more »

Appending a linked list onto another is pretty easy. All you have to do is, make the last node’s next pointer of the first list to point to the head… Read more »

Algorithm: [sourcecode lang=”cpp”] void RemoveDuplicates(intnode* head) { intnode* current = head; if (current == NULL) return; // do nothing if the list is empty // Compare current node with next… Read more »

Algorithm – Keep two pointer c and m. Always move c pointer at twice the speed of m pointer. If the linked list length is even that middle element will… Read more »

Algorithm Move the pointer 2 nodes at a time. If it points to a null node means Linked list is of EVEN length, else it points to a node whose… Read more »

[sourcecode lang=”cpp”] int Print_Reverse_LinkedList(intnode *c){ if(c==NULL) return 0; Print_Reverse_LinkedList(c->next); cout<<c->data<<"\t"; return 1; } [/sourcecode]

Algorithm: Use 2 pointers ptr and newptr. Initially both points to head node of the list. Move ptr ‘n’ times. After this, start moving both ptr and newptr till ptr… Read more »

Algorithm Take EndPosition to find as input Map all the list values, to attain constant searching time Find StartPosition by StartPosition=(Size_of_list-EndPosition)+1 Find the StartPosition corresponding value in map and print… Read more »

Doubly Linked List c++ code: [table caption=”Time Complexity”] From,Insert,Delete Head, O(1),O(1) Tail,O(1),O(1) [/table] 1. Node Class Declaration [sourcecode lang=”cpp”] class dllnode{ public: int data; dllnode *next; dllnode *prev; dllnode(){ data=0;… Read more »