This document contains summaries of several algorithms and data structures:
1) A second pattern matching algorithm that can find if a pattern exists in a string and the position if it does in 3 sentences or less.
2) Bubble sort, which compares adjacent elements and swaps them if out of order, in an ascending or descending order, iterating until the array is fully sorted.
3) Postfix notation which writes arithmetic expressions with operands before operators using stacks.
4) Infix notation and how it differs from postfix by writing expressions like X + Y.
5) A binary search tree where all nodes follow the properties of having left sub-tree keys less than the parent and right sub-tree
This document contains summaries of several algorithms and data structures:
1) A second pattern matching algorithm that can find if a pattern exists in a string and the position if it does in 3 sentences or less.
2) Bubble sort, which compares adjacent elements and swaps them if out of order, in an ascending or descending order, iterating until the array is fully sorted.
3) Postfix notation which writes arithmetic expressions with operands before operators using stacks.
4) Infix notation and how it differs from postfix by writing expressions like X + Y.
5) A binary search tree where all nodes follow the properties of having left sub-tree keys less than the parent and right sub-tree
This document contains summaries of several algorithms and data structures:
1) A second pattern matching algorithm that can find if a pattern exists in a string and the position if it does in 3 sentences or less.
2) Bubble sort, which compares adjacent elements and swaps them if out of order, in an ascending or descending order, iterating until the array is fully sorted.
3) Postfix notation which writes arithmetic expressions with operands before operators using stacks.
4) Infix notation and how it differs from postfix by writing expressions like X + Y.
5) A binary search tree where all nodes follow the properties of having left sub-tree keys less than the parent and right sub-tree
ID : 20191010010 SEC : A Second Pattern Matching Algorithm
By this second pattern matching algorithm
we can find out if a Pattern exists in a String or not And if exist we can find out the Position of the pattern in the string. Bubble sort Bubble sort is an algorithm that compares the adjacent elements and swaps their positions if they are not in the intended order. The order can be ascending or descending. Starting from the first index, compare the first and the second elements. If the first element is greater than the second element, they are swapped. Now, compare the second and the third elements. Swap them if they are not in order. The above process goes on until the last element.
The same process goes on for the remaining iterations. After
each iteration, the largest element among the unsorted elements is placed at the end. In each iteration, the comparison takes place up to the last unsorted element. The array is sorted when all the unsorted elements are placed at their correct positions. Postfix Expression Postfix notation is a notation for writing arithmetic expressions in which the operands appear before their operators. Using Stacks. Postfix notation is a notation for writing arithmetic expressions in which the operands appear before their operators. Infix Expression Infix, Postfix and Prefix notations are three different but equivalent ways of writing expressions. It is easiest to demonstrate the differences by looking at examples of operators that take two operands. Infix notation: X + Y. Binary Search Tree A Binary Search Tree (BST) is a tree in which all the nodes follow the below-mentioned properties − The value of the key of the left sub-tree is less than the value of its parent (root) node's key. The value of the key of the right sub-tree is greater than or equal to the value of its parent (root) node's key. Thank You