## Subsequence Vs Substring

Introduction If you are a programmer, then while studying data structures and algorithms, you might have come across the following problems: Find the length of the longest subsequence of one string which is a substring of another string. If not, ...

## How to Rearrange an Array such that arr[i]=i?

Introduction Let’s say you have an array of n numbers, and this array can contain numbers from 0 to n-1. And for the numbers up to n, which are not present in the array, it has -1.  Now we have ...

## Sort An Array Containing 0’s, 1’s and 2’s

Introduction Why don’t you give a try to solve the problem by yourself before reading the article from here are array Sort 0 1 2? Please make sure you try at least once it will help you understanding more. The ...

## How to perform Count Inversions in an array?

Inversion count for an array is defined as for an array (say arr) with size n, two elements form an inversion arr[i] and arr[j] for every i and j such that arr[i] > arr[j].  This problem is most asked in ...

## How to convert an object to an array in PHP?

Arrays are a collection of items which can be accessed by a single key. The article will explain on converting an object to an array in PHP. Because Arrays in PHP can be used for storing data which is logically ...

## Count & Toggle queries on Binary Array

This is the concept where both count and toggle queries are applied to the binary array. Count Query is used when there is a need to calculate a number of specific bits it appears in any piece of code. We ...

## What is Array Decay in C++ & how to prevent it?

In this article, we will learn about the concept of array decay in C++ and the various methods by which it can be prevented. The loss of size and dimensions of our array is called an array decay. It can lead ...

## Implementation of Deque Using A Circular Array

To implement Deque employing a circular array we should track 2 pointer front and rear within the array, all the operations are on these 2 pointers. The which means of circular array will be understood by the image below. In ...

## Mutating & Non-Mutating algorithms in C++

C++ STL has a bunch of algorithms in itself. Sorting, numeric, removal, modifying and non-modifying algorithms are some examples. In the article let’s talk about the famous mutating and non-mutating algorithms in C++. Mutating Algorithms: These algorithms are modifying algorithms ...

## Difference between ArrayList & LinkedList that everyone should know

One of the most famous interview questions for beginners as well as Java developers with two-three years of experience is the difference between ArrayList and LinkedList. Before getting into differences, let’s understand the similarities between ArrayList and LinkedList so that ...