Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Analysis of Algorithms Articles
Page 11 of 17
Planar straight line graphs (PSLGs) in Data Structure
In case of computational geometry, a planar straight-line graph, in short PSLG, (or straight-line plane graph, or plane straight-line graph) is defined as a term implemented for an embedding of a planar graph in the plane such that its edges are mapped into straight line segments. Statement of Fáry's theorem (1948) is that every planar graph has this kind of embedding.In case of computational geometry, PSLGs have often been termed planar subdivisions, with an assumption or assertion that subdivisions are polygonal.Without vertices of degree 1, a PSLG defines a subdivision of the plane into polygonal regions and vice versa. Absence ...
Read MoreRectangle Data in Data Structure
Multivariate cross-sectional data (i.e. not time-series or repeated measure) are indicated by rectangular data in which each column is a variable (feature), and each row is a case or record.First procedure of representing rectangle data is to map it onto a higher-dimensional point data and use point-based data structure procedures such as the grid file, PR quadtree, point quadtree, and k-d-tree. Procedure mapping of the rectangular data to a four-dimensional point can be performed in number techniques such as x and y coordinates of the opposite corners, or x and y coordinates of one corner and the width and height, ...
Read MoreBucketing Methods in Data Structure
Bucketing builds, the hash table as a 2D array instead of a single dimensional array. Every entry in the array is big, sufficient to hold M items (M is not amount of data. Just a constant).ProblemsLots of wasted space are created.If M is exceeded, another strategy will need to be implemented.Not so good performer for memory based implementations but doable if buckets are disk-based.For bucketing it is ok to have λ>1. However, the larger λ is the higher a chance of collision. λ>1 guarantees there will be minimum 1 collision (pigeon hole principle). That will enhance both the run time ...
Read MoreOptimal Lopsided Trees in Data Structure
The problem of finding optimal prefix-free codes for unequal letter costs consists of computing a minimum cost prefix-free code in which the encoding alphabet consists of unequal cost (length) letters, of lengths α and β, where α ≤ β. We restrict ourselves limited to binary trees.The code is represented by a lopsided tree, in the similar way as a Huffman tree represents the solution of the Huffman coding problem. Despite the similarity, the case of unequal letter costs is much difficult than the classical Huffman problem; no polynomial time algorithm is known or available for general letter costs, despite a ...
Read MoreHeight Limited Huffman Trees in Data Structure
The diagram of height limited or depth limited Huffman tree is given belowTree depth limitation is a non-trivial issue that most real-world Huffman implementations must deal with.Huffman construction doesn't limit the height or depth. If it would, it is not possible for it to be "optimal". Granted, the largest depth of a Huffman tree is bounded by the Fibonacci series, but that leave sufficient room for larger depth than wanted.What is the reason to limit Huffman tree depth? Fast Huffman decoders implement lookup tables. It's possible to implement multiple table levels to mitigate the memory cost, but a very fast ...
Read MoreHuffman Algorithm for t-ary Trees in Data Structure
A simple algorithmA collection of n initial Huffman trees is prepared, each of which is a single leaf node. Keep the n trees onto a priority queue organized by weight (frequency).Remove or delete the first two trees (the ones with smallest weight). Combine these two trees to create a new tree whose root is associated with the two trees as children, and whose weight is the sum of the weights of the two children trees.Keep this new tree into the priority queue.Repeat steps 2-3 until and unless all of the partial Huffman trees have been joined into one.It's a greedy ...
Read MoreHuffman Codes and Entropy in Data Structure
Huffman CodeA Huffman code is defined asa particular type of optimal prefix code that is commonly used for lossless data compression.The process of finding or implementing such a code proceeds by means of Huffman coding, an algorithm which was developed by David A. Huffman while he was a Sc.D. student at MIT, and published in the 1952 paper "A Method for the Construction of Minimum-Redundancy Codes".The output from Huffman's algorithm can be displayed as a variable-length code table for encoding a source symbol (such as a character in a file). The algorithm creates this table from the estimated probability or ...
Read MoreSplay in Virtual Tree in Data Structure
In virtual tree, some edges are treated as solid and some are treated as dashed. Usual splaying is performed only in the solid trees. To splay at a node y in the virtual tree, following method is implemented.The algorithm looks at the tree three times, once in each pass, and changes it. In first pass, by splaying only in the solidtrees, beginning from the node y, the path from y to the root of the overall tree, becomes dashed. This path is createdsolid by splicing. A final splay at node y will now create y the root of the tree. ...
Read MoreSolid Trees in Data Structure
For the given forest, we create some of the given edges “dashed” and the rest of them are kept solid. Each non-leaf node is associated with only one “solid” edge to one of its children. All other children will be connected with the help of a dashed edge.To be more concrete, in any given tree, the right-most link (to its child) should be kept solid, and all other links to its other children are created “dashed”.As a result, the tree will be broken into a collection of solid paths. The roots of solid paths will be joined to some other ...
Read MoreOptimality of Splay Trees in Data Structure
Dynamic optimality conjectureIn addition to the proven performance guarantees for splay trees there is an unproven conjecture with great interest. Dynamic optimality conjecture denotes this conjecture. Let any binary search tree algorithm such as B accesses an element y by traversing the path from the root to y at a cost of d(y)+1, and that between accesses can make any rotations in the tree at a cost of 1 per rotation. Let B(s) be the cost for B to perform the sequence s of accesses. Then the cost for a splay tree to perform the same accesses is O[n+B(s)].There are ...
Read More