Data Structure

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

Height of a Binary Tree

This tutorial explains the Height of the Binary Tree with some examples. In the following example there is a B Tree given, We have to find the Height of The Tree. What is the Height of The Binary Tree? The Height of a Tree Is equal to the largest numbers of edges from the Root …

Height of a Binary Tree Read More »

What is Recursion?

In this tutorial we will learn What is Recursion and how to use it with some examples. Recursion is a widely used phenomenon in computer science used to solve complex problems by breaking them down into simpler ones. It is the process by which a function calls itself directly or indirectly. The corresponding function is …

What is Recursion? Read More »

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 …

Best Time to Buy and Sell Stock Read More »

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 …

Factorial of a Number Read More »

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 …

Spiral Matrix With Examples Read More »

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

Sorting An Array In JavaScript Read More »