Articles on Trending Technologies

Technical articles with clear explanations and examples

Multiple Lists in a Single Array in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 892 Views

Array representation is basically wasteful of space when it is storing data that will change over time. To store some data, we allocate some space which is large enough to store multiple values in an array. Suppose we use the array doubling criteria to increase the size of the array.Consider the current array size is 8192. This is full. So we need to increase it by using array doubling technique. So new array size will be 16384. Then copy 8192 elements from old array to new array, then deallocate the old array. Now we can realize that before deallocating the ...

Read More

Melding Two Max HBLTs in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 379 Views

The meld strategy is done easily using recursion. Suppose A and B are two HBLTs, that will be melded. If one of them is empty, then simply make another one as final result. If no empty HBLT is there, then we have to compare the elements in the two roots. The root with larger element becomes the root of melded HBLT.Suppose A has larger root. And that is its left subtree is L. Suppose C be the max HBLT, that results from melding the right subtree of A and the HBLT B. The final HBLT will have A as root, ...

Read More

Deletion of Max Element from a Max HBLT In Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 242 Views

In Max HBLT, the root is placed at the root. If the root is deleted, then two max HBLTs, i.e. left and right will be separated. By melding together these two Max HBLT again, we can merge them into one. So after melding all elements will be there, except the deleted one.

Read More

Insertion Into a Max HBLT in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 402 Views

The insertion into Max HBLT, can be done using Max Meld operation. This operation is used to merge two Max HBLT into one Max HBLT. Suppose, we want to insert x into one max HBLT, called H. We will create a small HBLT using x, then meld this with H, then after melding, H will hold all elements including x. So melding operation is needed to perform the insertion operations for HBLT.

Read More

Height-Biased Leftist Trees in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 2K+ Views

Here we will see what is the Height Balanced Leftist Trees (HBLT). Consider a binary tree where a special node, called an external node replaces each empty subtree. All other nodes are called Internal Nodes. When some external nodes are added with some binary tree, then that is called an extended binary tree.If we do not consider the leaf edges of this tree, then that is the actual binary tree. and this is the extended binary tree.Now suppose s(x) be the length of a shortest path from node x to an external node in its subtree. If x is an ...

Read More

Acyclic digraphs in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 277 Views

Here we will see the what is the Acyclic digraphs. The acyclic digraphs are directed graphs containing no directed cycles. The Directed Acyclic Graphs are abbreviated as DAG.Every finite DAG has at-least one node whose out-degree is 0.Example of DAG with one node −Example of DAG with two nodes −Example of DAG with three nodes −

Read More

How to replace NA's to a value of selected columns in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Aug-2020 712 Views

In data analysis, finding some NA values in a data frame is very common but all the NA values do not create problems if the column that contain NA values is not useful for the analysis. We can replace all NA values to 0 or to any other for the columns that are useful.ExampleConsider the below data frame −> set.seed(99) > x1 x2 x3 x4 x5 df df   x1   x2   x3   x4    x5 1  NA   NA   25    NA 2  5     2   24    f    2 3  NA   ...

Read More

Rooted vs Unrooted Trees in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 3K+ Views

In this section we will see what are the differences between rooted and the unrooted trees. At first we will see some examples of Rooted, and Unrooted trees.Example of Rooted Tree −Example of Unrooted Tree −Basic Differences between rooted and Unrooted treesIn a rooted tree, each node with descendants represents the inferred most recent common ancestors of the descendants. In some trees, the edge lengths may be interpreted as time estimates.For the unrooted trees, there is no ancestral root. Unrooted trees represent the branching order, but do not indicate the root of the location of the last common ancestor.

Read More

Unrooted binary tree in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 723 Views

Here we will see the what is the unrooted binary tree. These trees are connected undirected graph with no cycle. The vertices with one neighbor are the leaves of the tree. Remaining vertices are internal nodes. The degree of the vertices is its number of neighbors. In a tree with more than one node, the leaves are the vertices of degree one.Free tree is one type of binary tree, where all internal nodes have exactly degree three. In Computer Science, binary trees are often rooted, and ordered, when they are used as data structures, but the applications of unrooted binary ...

Read More

Tournament Trees, Winner Trees and Loser Trees in Data Structure

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Aug-2020 10K+ Views

Here we will see the Tournament trees, Winner and Looser trees. The Tournament tree is a complete binary tree with n external nodes and n – 1 internal nodes. The external nodes represent the players, and the internal nodes are representing the winner of the match between the two players. This tree is also known as Selection tree.There are some properties of Tournament trees. These are like below −This tree is rooted. So the link in the tree and directed path from parent to children, and there is a unique element with no parentsThe parent value is less or equal ...

Read More
Showing 51691–51700 of 61,297 articles
Advertisements