# Data Structure

A Data Structure is a storage that is used to store and organized data.

## Best Time to Buy and Sell Stock

In this tutorial we will learn how to deduct Best Time to Buy And Sell Stock To Get maximum profit. Below are some examples. This problem can be solved by various approaches. Problem? Given an array of N length, representing the process of the stocks on different days. The task is to find the maximum …

## Remove Duplicates From An Array In JavaScript

There are various methods to Remove Duplicates from An Array in JavaScript. We will discuss the most common methods from them. What are Duplicates in An Array? Duplicate values are those values which are presented more than one time in the array. So in this tutorial we will remove those duplicate values from the array …

## Factorial of a Number

Factorial for a non-negative integer or number is the multiplication of all positive integers less than or equal to the value. For example factorial for a 5 is 5x4x3x2x1 = 120. This is a part of Data Structure. The above calculation is achieve by the formula of ‘n!’ which can be represent as below. This …

## Spiral Matrix With Examples

In this tutorial we will learn how to Spiral A Matrix with examples. In other words Spirally Traverse of a Matrix using best approach of algorithm. This is a part of Data Structure. How To Spiral A Matrix? We have a input Matrix as shown above. It could have any length. Now we have to …

## Trapping Rain Water Problem In JavaScript

In this tutorial we will learn about Rain Water Trapping Problem with some examples. This is a part of Data Structure. What is Rain Water Trapping Problem in Data Structure? In simple way, we have many building placed left and right to each other. All buildings have different heights as shown in above image.We have …

## Find Maximum Product Subarray Using JavaScript

In this tutorial we will learn how to Find Maximum Product Subarray from an integer of array. The maximum product subarray is the part or an array which have maximum value of multiplying the subarray elements. What is Maximum Product Subarray Problem? Given an array that contains both positive or negative integers. Find the product …

## Kadane’s Algorithm In JavaScript With Example

In this tutorial we will learn about Kadane’s Algorithm with examples in JavaScript. What is Kadane’s Algorithm? It is an iterative dynamic programming algorithm. It calculated the maximum sum subarray ending at a particular position by using the maximum sum subarray ending at the previous position. In this tutorial we learn using JavaScript. Kadane Algorithm …

## JavaScript Array Filter With some examples

In this tutorial we will learn about Filter An Array In JavaScript with some examples. Array is an important part of any programming language which is mostly used to manipulate the data. An array contains iterable data which can be iterate using loop. How To Search Data in An Array or Objects of Array In …

## Includes Method in JavaScript With Example

In this tutorial we will learn about includes() function in JavaScript. How to Use includes() Function in JavaScript? Generally it compares two string and returns true if string contains the specific string otherwise it returns false. It also returns true if some of part completely matches the string. => includes(value, position) We can also provide …

## Sorting An Array In JavaScript

In this tutorial we will learn , How to sort different types of array in JavaScript. Generally sorting needed in table’s column. On clicking the column name it sorted by ascending or descending order. We will sort a string array, integer array and objective array with examples. How to sort an array in JavaScript? 1. …

Scroll to Top