### Parenthesis matching using stack

Parenthesis matching algorithm PARENTHESIS_MATCHING (EQ, VALID) This algorithm checks whether the expression EQ written in infix notation is valid or not and assigns TRUE or FALSE to VALID. 1. Scan EQ from left to right until the end of the equation is encountered: 2.     If”(“is encountered then: put it in the STACK. 3.    […]

### Polish Notation

In polish notation, the operator is placed before the operands. Polish notation has types called Infix, Postfix, and Prefix notation. Infix Notation: In this notation, the operator symbol is placed between its two operands. For example, to add A to B we can write as A + B, to subtract D from C we write […]

### 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 […]

### Operations on Stack

Operations on stacks: The following operations are performed on stacks. Creating an empty stack PUSH (STACK. ITEM) – to push element ITEM onto stack STACK POP (STACK) to access and remove the top element of the stack STACK PEEK (STACK) to access the top element of the stack STACK without removing the top element from […]

### 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 […]

### Heap Sorting in C Programming

HEAP SORTING: – In this method, a tree structure called a heap is used. A heap is a type of binary tree. An ordered balanced binary tree is called a min heap where the value at the root of any sub-tree is less than or equal to the value of either of its children. An […]

### Quick Sorting in C Programming

QUICK SORTING: – Quick Sort is an algorithm that also likes to merge sort and uses the idea of divide and conquers. This algorithm finds the element that divides (splits) the array into halves in such a way that the elements in the left sub-array are less than and the elements in the right sub […]

### Radix sorting in C Programming

RADIX SORTING:– A radix sort also called Bucket sort is the method used by most people when sorting a list of namesphabetic order. The procedure we follow: (a) First the names are grouped according to the first letter, thus the names are arranged in 26 classes, one for each letter of the alphabet. The first […]

### Merge Sorting in C Programming

MERGE SORTING: – Merging means combining two sorted lists into one sorted list. For this, the elements from both the sorted lists are compared. The smaller of both the elements are then stored in the third array Merge Sort is a sorting algorithm that uses the idea of divide and conquers This algorithm divides the […]