File tree Expand file tree Collapse file tree 4 files changed +957
-0
lines changed
Expand file tree Collapse file tree 4 files changed +957
-0
lines changed Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <OutputType >Exe</OutputType >
5+ <TargetFramework >netcoreapp3.0</TargetFramework >
6+ <RootNamespace >_3._2._34</RootNamespace >
7+ </PropertyGroup >
8+
9+ <ItemGroup >
10+ <ProjectReference Include =" ..\BinarySearchTree\BinarySearchTree.csproj" />
11+ </ItemGroup >
12+
13+ </Project >
Original file line number Diff line number Diff line change 1+ using System ;
2+ using BinarySearchTree ;
3+
4+ namespace _3 . _2 . _34
5+ {
6+ class Program
7+ {
8+ static void Main ( string [ ] args )
9+ {
10+ var bst = new ThreadedST < int , int > ( ) ;
11+ bst . Put ( 10 , 10 ) ;
12+ bst . Put ( 4 , 4 ) ;
13+ bst . Put ( 12 , 12 ) ;
14+ bst . Put ( 9 , 9 ) ;
15+ bst . Delete ( 9 ) ;
16+ bst . Put ( 3 , 3 ) ;
17+ bst . Put ( 8 , 8 ) ;
18+
19+ var key = bst . Min ( ) ;
20+ while ( key != 0 )
21+ {
22+ Console . Write ( key + " " ) ;
23+ key = bst . Next ( key ) ;
24+ }
25+ Console . WriteLine ( ) ;
26+ key = bst . Max ( ) ;
27+ while ( key != 0 )
28+ {
29+ Console . Write ( key + " " ) ;
30+ key = bst . Prev ( key ) ;
31+ }
32+ }
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments