File:AvlTreeDeleteExample.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 700 × 406 pixels, file size: 51 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: An Example for deleting items in an AVL tree
Date
Source Own work
Author Dirk Hünniger

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
You may select the license of your choice.

Creation[edit]

I used the dot program of the graphviz package to create the graphs. I use inkscape to postprocess it. Here is the source of to be fed into the dot program.

digraph G {
	//size="5,5"
	//ratio=compress
	//compound=true;
	subgraph clusterb1 {
		label="before first rotation (single) ";
		node [shape="record"];
		b121[label="<f0>|<f1> 21|<f2>"];
		b111[label="<f0>|<f1> 11|<f2>",style=filled,color=grey];
		b115[label="<f0>|<f1> 15|<f2>"];
		b112[label="<f0>|<f1> 12|<f2>"];
		b120[label="<f0>|<f1> 20|<f2>"];
		b132[label="<f0>|<f1> 32|<f2>"];
		b156[label="<f0>|<f1> 56|<f2>"];
		b121:f0->b111;
		b121:f2->b132;
		b111:f2->b115;
		b115:f0->b112;
		b115:f2->b120;
		b132:f2->b156;
	}
	subgraph clustera1 {
		label="after first rotation ";
		node [shape="record"];
		a121[label="<f0>|<f1> 21|<f2>"];
		a111[label="<f0>|<f1> 11|<f2>"];
		a115[label="<f0>|<f1> 15|<f2>"];
		a112[label="<f0>|<f1> 12|<f2>"];
		a120[label="<f0>|<f1> 20|<f2>"];
		a132[label="<f0>|<f1> 32|<f2>"];
		a156[label="<f0>|<f1> 56|<f2>"];
		a121:f0->a115;
		a121:f2->a132;
		a111:f2->a112;
		a115:f2->a120;
		a115:f0->a111;
		a132:f2->a156;
	}
	subgraph clusterb2 {
		label="before second rotation (double)";
		node [shape="record"];
		b221[label="<f0>|<f1> 21|<f2>"];
		b211[label="<f0>|<f1> 11|<f2>"];
		b215[label="<f0>|<f1> 15|<f2>",style=filled,color=grey];
		b212[label="<f0>|<f1> 12|<f2>"];
		b232[label="<f0>|<f1> 32|<f2>"];
		b256[label="<f0>|<f1> 56|<f2>"];
		b221:f0->b215;
		b221:f2->b232;
		b211:f2->b212;
		b215:f0->b211;
		b232:f2->b256;
	}
	subgraph clustera2 {
		label="after second rotation ";
		node [shape="record"];
		a221[label="<f0>|<f1> 21|<f2>"];
		a211[label="<f0>|<f1> 11|<f2>"];
		a215[label="<f0>|<f1> 15|<f2>"];
		a212[label="<f0>|<f1> 12|<f2>"];
		a232[label="<f0>|<f1> 32|<f2>"];
		a256[label="<f0>|<f1> 56|<f2>"];
		a221:f0->a212;
		a221:f2->a232;
		a212:f2->a215;
		a212:f0->a211;
		a232:f2->a256;
	}	
	subgraph clusterb3 {
		label="before thrid rotation (single)";
		node [shape="record"];
		b311[label="<f0>|<f1> 11|<f2>"];
		b315[label="<f0>|<f1> 15|<f2>"];
		b312[label="<f0>|<f1> 12|<f2>"];
		b332[label="<f0>|<f1> 32|<f2>",style=filled,color=grey];
		b332:f0->b312;
		b312:f2->b315;
		b312:f0->b311;
	}	
	subgraph clustera3 {
		label="after thrid rotation ";
		node [shape="record"];
		a311[label="<f0>|<f1> 11|<f2>"];
		a315[label="<f0>|<f1> 15|<f2>"];
		a312[label="<f0>|<f1> 12|<f2>"];
		a332[label="<f0>|<f1> 32|<f2>"];
		a332:f0->a315;
		a312:f2->a332;
		a312:f0->a311;
	}
}

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current15:50, 4 May 2009Thumbnail for version as of 15:50, 4 May 2009700 × 406 (51 KB)Dirk Hünniger (talk | contribs){{Information |Description={{en|1=An Example for deleting items in an AVL tree}} |Source=Own work by uploader |Author=Dirk Hünniger |Date=4 May 2009 |Permission= |other_versions= }} <!--{{ImageUpload|full}}--> [[Category:AVL-tree

There are no pages that use this file.