B-tree: Properties, Insertion Operation in B-tree

A B-tree is an extended version of m-way. There are some drawbacks with the m way tree is, in the worst case, it may behave like a linked list because it has no rule over the number of keys in node. To resolve this B-tree is introduced which is balanced. Here balanced means all leaf … Read more

Compaction, Overflow and Underflow in Array

Compaction Garbage collection is the process of collecting all unused nodes and returning them to available space. This process is carried out in essentially two phases. The first phase is marking phase where all node which is in use is marked. And Second Phase is compaction where all free partitions are made contiguous and merged … Read more

Consider the linear arrays AAA[5:50],BBB[-5:10] and CCC[1:8]

Consider the linear arrays AAA[5:50], BBB [-5:10] and CCC[1:8]. (a) Find the number of elements in each array (b) Suppose Base(AAA) = 300 and w=4 words per memory cell for AAA. Find the address of AAA[35] ,AAA[15], and AAA[55] (a) Length = Upper Bound – Lower Bound +1Length(AAA) = 50-5+1 = 46Length(BBB) = 10-(-5)+1 = … Read more

Matrix Multiplication Algorithm and Program

In this tutorial, we’re going to learn an algorithm for Matrix multiplication along with its Program. Matrix is basically a two-dimensional array that can have any number of rows and any number of columns. Matrix multiplication procedure is not the same as a simple multiplication of numbers but it follows certain distinct ruleswhich must be … Read more

Infix to Prefix conversion Algorithm with example

To convert Infix to prefix using the stack, first reverse the infix expression and at last again reverse the output expression to get prefix expression. We have operator’s stack, output’s stack and one input string. Operator’s stack works as FILO(First In Last Out). Output’s stack works as FIFO (First In First Out). Infix to Prefix … Read more

Postfix to Infix Conversion Algorithm, example and program

In this tutorial We have explored an algorithm to convert a given Postfix expression to Infix expression using Stack. Algorithm For Postfix to Infix Conversion Iterate the given expression from left to right, one character at a time Step 1 : If a character is operand, push it to stack. Step 2: If a character … Read more

Infix to Postfix Conversion: Algorithm and Example

In infix to postfix conversion we will use stack data structure. We have operator’s stack, output’s stack and one input string. Operator’s stack works as FILO(First In Last Out). Output’s stack works as FIFO (First In First Out). Converting an infix expression to postfix is like changing the way we write math problems so computers … Read more

Circular Queue Representation using Array

A circular queue is a linear data structure that follows FIFO principle. In circular queue, the last node is connected back to the first node to make a circle. In Circular queue elements are added at the rear and elements are deleted from front. We can represent circular queue using array as well as linked … Read more