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 ...

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 ...

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 ...

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 ...

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 ...

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 ...

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 ...

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. ...

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 ...

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 ...