91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 153KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-21
  • 語言: 其他
  • 標簽: AVL樹??紅黑樹??

資源簡介

本人實現的 AVL樹與紅黑樹,具有可視化界面,代碼清晰。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;

namespace?AdvancedSearchDataStructure
{
????public?interface?INode
????{
????????//?Properties
????????int?BF?{?get;?}
????????int?Data?{?get;?}
????????INode?Left?{?get;?}
????????INode?Right?{?get;?}
????}

????public?class?Node?:?INode
????{
????????//?Fields
????????private?int?_bf;
????????private?int?_data;
????????private?Node?_left;
????????private?Node?_right;

????????//?Methods
????????public?Node(int?value)
????????{
????????????this._data?=?value;
????????}

????????public?override?string?ToString()
????????{
????????????return?this._data.ToString();
????????}

????????//?Properties
????????public?int?BF
????????{
????????????get
????????????{
????????????????return?this._bf;
????????????}
????????????set
????????????{
????????????????this._bf?=?value;
????????????}
????????}

????????public?int?Data
????????{
????????????get
????????????{
????????????????return?this._data;
????????????}
????????????set
????????????{
????????????????this._data?=?value;
????????????}
????????}

????????public?Node?Left
????????{
????????????get
????????????{
????????????????return?this._left;
????????????}
????????????set
????????????{
????????????????this._left?=?value;
????????????}
????????}

????????INode?INode.Left
????????{
????????????get
????????????{
????????????????return?this._left;
????????????}
????????}

????????INode?INode.Right
????????{
????????????get
????????????{
????????????????return?this._right;
????????????}
????????}

????????public?Node?Right
????????{
????????????get
????????????{
????????????????return?this._right;
????????????}
????????????set
????????????{
????????????????this._right?=?value;
????????????}
????????}
????}

????public?interface?IBinaryTree
????{
????????//?Properties
????????INode?Head?{?get;?}

????????bool?Insert(int?value);
????????bool?Remove(int?value);

????????bool?ClearTree();
????}

????public?class?AVLTree?:?IBinaryTree
????{
????????//?Fields
????????private?Node?_head;

????????private?Node[]?path?=?new?Node[128];?//記錄訪問路徑上的結點
????????private?int?p;?//表示當前訪問到的結點在_path上的索引

????????//?Methods
????????public?bool?Insert(int?value)
????????{
????????????Node?newNode?=?new?Node(value);
????????????//如果是空樹,則新結點成為二叉排序樹的根
????????????if?(_head?==?null)
????????????{
????????????????_head?=?newNode;
????????????????_head.BF?=?0;
????????????????return?true;
????????????}

????????????p?=?0;
????????????//prev為上一次訪問的結點,current為當前訪問結點
????????????Node?prev?=?null?current?=?_head;
????????????while?(true)
????????????{
????????????????path[p++]?=?current;

????????????????prev?=?current;
????????????????if?(value?????????????????{
????????????????????current?=?current.Left;
????????????????????if?(current?==?null)
????????????????????{
????????????????????????p

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????13365??2012-05-27?00:00??RBTree2.cs
?????文件????????4712??2012-05-25?22:50??TreeGraphics.cs
?????目錄???????????0??2013-01-04?15:16??bin\
?????目錄???????????0??2013-01-04?15:16??bin\Debug\
?????文件???????27136??2012-12-07?15:35??bin\Debug\AdvancedSearchDataStructure.exe
?????文件???????87552??2012-12-07?15:35??bin\Debug\AdvancedSearchDataStructure.pdb
?????文件???????11600??2012-06-07?19:37??bin\Debug\AdvancedSearchDataStructure.vshost.exe
?????文件?????????490??2010-03-17?22:39??bin\Debug\AdvancedSearchDataStructure.vshost.exe.manifest
?????目錄???????????0??2013-01-04?15:16??bin\Release\
?????文件???????22528??2012-05-25?11:34??bin\Release\AdvancedSearchDataStructure.exe
?????文件???????69120??2012-05-25?11:34??bin\Release\AdvancedSearchDataStructure.pdb
?????目錄???????????0??2013-01-04?15:16??obj\
?????目錄???????????0??2013-01-04?15:16??obj\x86\
?????目錄???????????0??2013-01-04?15:16??obj\x86\Debug\
?????文件????????2111??2012-07-24?21:09??obj\x86\Debug\AdvancedSearchDataStructure.csproj.FileListAbsolute.txt
?????文件???????27136??2012-12-07?15:35??obj\x86\Debug\AdvancedSearchDataStructure.exe
?????文件????????1154??2012-12-07?15:35??obj\x86\Debug\AdvancedSearchDataStructure.Form1.resources
?????文件???????87552??2012-12-07?15:35??obj\x86\Debug\AdvancedSearchDataStructure.pdb
?????文件?????????180??2012-12-07?15:35??obj\x86\Debug\AdvancedSearchDataStructure.Properties.Resources.resources
?????文件????????4440??2012-05-26?23:46??obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6392??2012-12-07?15:35??obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????1110??2012-12-07?15:35??obj\x86\Debug\GenerateResource.read.1.tlog
?????文件????????1770??2012-12-07?15:35??obj\x86\Debug\GenerateResource.write.1.tlog
?????目錄???????????0??2012-05-25?20:41??obj\x86\Debug\TempPE\
?????目錄???????????0??2013-01-04?15:16??obj\x86\Release\
?????文件????????1114??2012-05-23?13:11??obj\x86\Release\AdvancedSearchDataStructure.csproj.FileListAbsolute.txt
?????文件???????22528??2012-05-25?11:34??obj\x86\Release\AdvancedSearchDataStructure.exe
?????文件?????????180??2012-05-25?11:34??obj\x86\Release\AdvancedSearchDataStructure.Form1.resources
?????文件???????69120??2012-05-25?11:34??obj\x86\Release\AdvancedSearchDataStructure.pdb
?????文件?????????180??2012-05-25?11:34??obj\x86\Release\AdvancedSearchDataStructure.Properties.Resources.resources
?????文件????????2152??2012-05-23?12:54??obj\x86\Release\DesignTimeResolveAssemblyReferences.cache
............此處省略18個文件信息

評論

共有 條評論