## Introduction and Implementation of Circular Linked List

Introduction Almost all of us have played Chinese Whispers. If you haven’t, it’s a game where a person whispers a message to the next person until the end of the row. This game is popularly played to break the ice ...

## Cloning a Linked List with Next and Random Pointer

Introduction In this article, we will discuss a very interesting problem – Clone a linked list with next and random pointer. There are problems where you need to clone a singly linked list or a doubly-linked list, but this one ...

## Type Casting and Type Conversion In C++: Part 2

Introduction In this article, we’ll be continuing the discussion on Type Casting and Type Conversion in C++. So far, we’ve discussed Implicit Conversion and C-style Type Casting. If you have prior knowledge of these concepts, then go ahead. Otherwise, we ...

## Insertion in Threaded Binary Search Tree

Introduction A. J. Perlis and C. Thornton have proposed a new binary tree called “Threaded Binary Tree“, which uses NULL pointers to improve its traversal process. In a threaded binary tree, NULL pointers are replaced by references of other nodes ...

## Type Casting and Type Conversion in C++ | Part-1

Introduction In general, the act of changing from one form to another is conversion. An example of conversion ( or transformation) is exchanging dollars for euros. In simple words, it’s converting the existing item with the newly desired item. They ...

## Merge Sort For Linked List

Introduction Sorting in programming refers to placing the elements of a data structure in a specific and meaningful manner. Sorting is an essential part of data processing. Efficient sorting algorithms are crucial so that we can perform operations that require ...

## Conversion from a Binary Tree to a Threaded Binary Tree

Table of Contents Introduction Structure of Node in Threaded Binary Tree How to convert a binary tree to a threaded binary tree? Approach 1 Approach 2 (Better Solution) Frequently Asked Questions Key Takeaways Introduction A threaded binary tree is just ...

## Minimum Number of Swaps to Sort an Array

Introduction Imagine you are given a bunch of food items to eat. It includes your favourite as well as your non-favourite food items. Now you have to decide according to your preference which item you would like to eat first. ...

## Understanding Stock Span

Introduction Let’s start with reading the problem statement of Stock Span –  You are given a list of stock prices of “n” days, and you need to find the span of each stock’s price for all the “n” days.  Consider ...

## Longest Consecutive Subsequence

Introduction In this blog, you learn to solve the problem Longest Consecutive Subsequence. But before that, you need to be very clear about the definition of subsequence. Most of the people remain confused between subarray and subsequence, so let’s discuss ...