<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>trees Archives -</title>
	<atom:link href="https://mitindia.in/tag/trees/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/trees/</link>
	<description></description>
	<lastBuildDate>Sat, 31 Dec 2016 06:05:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>trees Archives -</title>
	<link>https://mitindia.in/tag/trees/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Data structure &#8211; Advanced Trees</title>
		<link>https://mitindia.in/data-structure-advanced-trees/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Thu, 01 Dec 2016 05:44:13 +0000</pubDate>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[advanced trees]]></category>
		<category><![CDATA[data insertion]]></category>
		<category><![CDATA[data structure]]></category>
		<category><![CDATA[trees]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=621</guid>

					<description><![CDATA[<p>Advanced Trees &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Definition of an AVL tree: An AVL tree is a binary search tree which has the following properties: 1. The sub-trees of every node differ in height by at most one. 2. Every sub-tree is an AVL tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees [&#8230;]</p>
<p>The post <a href="https://mitindia.in/data-structure-advanced-trees/">Data structure &#8211; Advanced Trees</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><span style="color: #993300;">Advanced Trees</span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</h1>
<p>Definition of an AVL tree: An AVL tree is a binary search tree which has the following properties:</p>
<p>1. The sub-trees of every node differ in height by at most one.<br />
2. Every sub-tree is an AVL tree.</p>
<p>Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed.</p>
<p><strong> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- mylink -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1696390399604457"
     data-ad-slot="7690934410"
     data-ad-format="link"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></strong></p>
<h2><strong>Features of AVL Trees</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</h2>
<p style="text-align: justify;">AVL Trees are derived from binary search trees by applying one condition; the difference of height between the left and right sub-trees should not exceed 1.<br />
These types of binary trees are also called Balanced binary trees.</p>
<p>The balance factor can have values of –1, 0 and 1. If the balance factor holds any other values, then it is not considered as an AVL tree. The three values given above represent different conditions of AVL trees. They are –<br />
1. balance = -1: the height of the left sub-tree of the current node is less than its right sub-tree by 1.<br />
2. balance = 0: the heights of the left and right sub-trees of the current node are equal<br />
3. balance = 1: the height of the left sub-tree is one more than the right sub-tree</p>
<p><strong>Representation of AVL Trees</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
struct AVL<br />
{<br />
struct AVL *left;<br />
int value;<br />
struct AVL *right;<br />
int balance;<br />
};<br />
<strong>Insertion of a Node</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Inserting a node in an AVL tree is similar to the binary search tree.</p>
<p>To balance a tree, an operation called rotation is performed<br />
Inserting a node may change the balancing factor of other nodes and thus may not satisfy the conditions of the AVL tree.</p>
<p>To balance a tree, an operation called rotation is performed.<br />
To rotate the tree about a node is to move the nodes either left or right so that the inorder traversal remains the same.<br />
<strong>Deletion of a node</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
The deletion performed on a node in AVL tree is the same as that of the deletion process of the Binary search tree.</p>
<p>First the node to be deleted is searched using the binary search method.</p>
<p>The node is deleted and other nodes are adjusted to maintain the inorder traversal.</p>
<p>After the node is deleted, balancing operation is performed which is the same as of that done during the insertion operation.<br />
<strong>Definition of a B tree</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
A B-tree is a data structure that maintains an ordered set of data and allows efficient operations to find, delete, insert, and browse the data. In this discussion, each piece of data stored in a B-tree will be called a &#8220;key&#8221;, because each key is unique and can occur in the B-tree in only one location</p>
<p><strong>Representation of B Trees</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
struct Bnode<br />
{<br />
int n;<br />
int value[MAX + 1];<br />
struct Bnode *child[MAX + 1];<br />
};<br />
<strong>Operations on B-Trees</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
When the tree is large and stored in secondary storage medium, the searching operation may consume time.</p>
<p>One way of reducing the time is to take up many nodes for comparison. As a result Multi-way search trees were developed.</p>
<p>1. Insertion operation in B-tree</p>
<p>2. Deletion process in B-tree</p>
<p>Insertion operation in B-tree: To insert a value in a B-tree, the node in the tree after which it can be inserted is searched first. Once the node is found, insertion process begins.</p>
<p>Deletion operation in B-tree: To delete a node, first the value to be deleted is searched. Once the node, which contains the value, is found the deletion process starts. There are some conditions that has to be taken care after deleting a node.<br />
<strong>Conditions on Deletions</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
When the number of values in the current node is greater or equal to the minimum number the node has to hold. In this case, the deletion of the node does not violate the conditions for the B-tree</p>
<p>When the number of values in the current node is less than the minimum number the node has to hold. Here the tree has to be adjusted so that the conditions for the B-tree is not violated.</p>
<p><span style="color: #000000;"><a style="color: #000000;" href="http://www.mitindia.in/2016/11/24/trees-data-structure/">Introduction to Trees [data structure]</a></span></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-structure-advanced-trees%2F&amp;linkname=Data%20structure%20%E2%80%93%20Advanced%20Trees" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-structure-advanced-trees%2F&amp;linkname=Data%20structure%20%E2%80%93%20Advanced%20Trees" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fdata-structure-advanced-trees%2F&#038;title=Data%20structure%20%E2%80%93%20Advanced%20Trees" data-a2a-url="https://mitindia.in/data-structure-advanced-trees/" data-a2a-title="Data structure – Advanced Trees"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/data-structure-advanced-trees/">Data structure &#8211; Advanced Trees</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
