Prefix To Infix
Prefix to Infix Conversion. Algorithm to convert Prefix to Infix. using Stack. Read Prefix Expression from right-to-left, in reverse order.
Prefix to Infix Conversion. Algorithm to convert Prefix to Infix. using Stack. Read Prefix Expression from right-to-left, in reverse order.
Evaluation of Prefix Expression is faster than an Infix Expression. This is because Prefix Expression has no parenthesis or precedence rules.
Reverse the given Linked List is Group of given size K using recursion (recursively) and without recursion (iteratively).
Linked List can be reversed both recursively and iteratively. Reverse a Linked List using recursion. Reverse a Linked List using iteration.
To check if the grammar is LL(1). The following rules must be satisfied. For A->a|b, FIRST(a) and FIRST(b) do not have contain common terminal.
Given a LL(1) Grammar, write a program to display LL(1) parsing table for the grammar. The program reads data from the file.
FIRST(A) is defined as a set of terminals that begin the strings defined by A. If A derives ‘Є’ then ‘Є’ is in FIRST(A).FOLLOW(A) for a non-terminal A is defined as a set of terminals that can appear on the right side of A in the sentential form. FOLLOW is only applied for non-terminals. The FOLLOW of start symbol always contain the end marks ‘$’.
Given a Binary Tree, print level order traversal. Example, Input Binary Tree Output 10 5 20 4 8 15 25 Algorithm We will discuss two ways to print the level order traversal of the binary tree. Both use queue and are very similar. Level Order Traversal Using Queue First Approach As we know, queue follows …
Binary search and Ternary search algorithms are used to search an element in a sorted array. Binary search reduces the array by 1/2 on each iteration whereas Ternary search reduced array size by 1/3 on each iteration. The Time complexity of Binary Search is log2(N).The Time complexity of Ternary Search is log3(N). Ternary search should …
Why Binary Search is Preferred over Ternary Search? Read More »
Ternary search is a searching algorithm that searches an element in a sorted array. Algorithm Ternary search works similar to Binary search. The only difference is instead of dividing the array into 2 parts, the array is divided into three parts and 2 parts are rejected on each iteration. That is, the array is reduced …