Consider simple representation (without any dummy node) of Linked List. Functions that operate on such Linked lists can be divided in two categories:
1) Functions tha...

Share

Prerequisites : Union Find (or Disjoint Set), Disjoint Set Data Structures (Java Implementation)
A disjoint-set data structure maintains a collection S = {S1, S2,...

Share

Assume the structure of a Linked List node is as follows.
struct Node
{
  int data;
  struct Node *next;
};
Explain the fu...

Share

Why is Quick Sort preferred for arrays?
Below are recursive and iterative implementations of Quick Sort and Merge Sort for arrays.
Recursive Quick Sort for array.
Ite...

Share

In previous article Skip List | Set 2 (Insertion) we discussed the structure of skip nodes and how to insert an element in the skip list. In this article we will disc...

Share

In general, array is considered a data structure for which size is fixed at the compile time and array memory is allocated either from Data section (e.g. global array...

Share

Given a pointer to a node to be deleted, delete the node. Note that we don’t have pointer to head node.
Recommended: Please solve it on “PRACTICEȁ...

Share

Given a sorted linked list and a value to insert, write a function to insert the value in a sorted way.
Initial Linked List
Linked List after insertion of 9
Recom...

Share

Given a Linked List, write a function that accepts the head node of the linked list as a parameter and returns the value of node present at (floor(sqrt(n)))th positio...

Share

Given a singly linked list and a number k, write a function to find the (n/k)-th element, where n is the number of elements in the list. We need to consider ceil valu...

Share