### Quick Sorting (Recursive and Non Recursive)

Algorithm Quick sorting (Nonrecursive) QUICK(A, N, BEG, END, LOC) Here A is an array with N elements. Parameters BEG and END contain the boundary values of the sub-list of A to which this procedure applies. LOC keeps track of the position of the first element. A[BEG] of the sub list during the procedure. The local […]

### Tower of Hanoi (Recursive & Non-recursive)

Algorithm – Tower of Hanoi (recursive) TOWER(N,BEG,AUX,END)This procedure gives a recursive solution to the Towers of Hanoi problem for N disks. 1. If N = 1, then:         (a) Write: BEG -> END.         (b) Return.    [End of If structure.] 2. [Move N – 1 disks from BEG to AUX.]  […]

### Mathematical Notation in Data Structure

Mathematical Notation in Data Structure – First of all we will consider various types of notations for writing mathematical expressions. there is the following set of operations. Symbol Used Operation Performed Precedence ^ (Exponention) Power Highest * (Asterisk) Multiplication Next Highest / (Slash) Division Next Highest + (Plus) Addition Lowest – (Hyphen) Subtraction Lowest Note […]

### Selection Sorting Algorithm

Selection Sorting Algorithm: The selection sort starts from the first element and searches the entire list until it finds the minimum value. The sort places the minimum value in the first place, selects the second element, and searches for the second smallest element. The process continues until the complete list is sorted. A selection sort […]

### Matrix in Programming

Two-dimensional array(Marix) – A two-dimensional array is a list of finite numbers m*n homogeneous data elements such that the element of the array is referenced by two index sets consisting of m and n consecutive integer numbers. the elements of the array are stored in consecutive The size of two – a dimensional array is […]

### Arrays in Data Structure

An array is a list of a finite number of homogenous data elements (i.e. data elements of the same type) Arrays can be classified as One – dimensional array or linear array that requires only one index to access an individual element of the array. Two – dimensional arrays require two indices to access an individual […]

### Algorithm to Calculate factorial using function

In this tutorial, we will write an algorithm to calculate factorials using the function. using this algorithm we can make a program to calculate factorial using functions in most programming languages like java python c++ and c programming. Algorithm to Calculate factorial using function. 1. Read N. 2. ANS=FACT(N). 3. Write ANS. 4. Exit [This […]

### Algorithm for Linear Search in Array

In this tutorial, we are going to write a Linear search algorithm in Array. using this algorithm we can write a program to linear search in the array for an element in almost every programming language like java, python, c++, and c programming. Algorithm for Linear Search in Array. 1. Read N 2. Repeat step3 […]

### Algorithm to reverse a given number

In this tutorial, we are going to write an Algorithm to reverse the digits of given n-digit numbers. using this algorithm we can write a program to reverse the digits of given n-digit numbers or a number in almost most programming languages like java python c++ and c programming. Algorithm to reverse a given number. […]