Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
max & min binary search tree
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CodingAlgorithms { partial class BinarySearchTree { public int GetMin(NodeBT root) { NodeBT cur = root; while (cur.Left != null) cur = cur.Left; return cur.Data; } //Returns the data in the farthest right node public int GetMax(NodeBT root) { NodeBT cur = root; while (cur.Right != null) cur = cur.Right; return cur.Data; } ////Run in Program.cs to test //BinarySearchTree bst = new BinarySearchTree(); //bst.Add(5); //bst.Add(10); //bst.Add(15); //bst.Add(-7); //bst.Add(2); //bst.Add(26); //bst.Add(98); //Console.WriteLine(bst.GetMin(bst.Root)); //Console.WriteLine(bst.GetMax(bst.Root)); } }
run
|
edit
|
history
|
help
0
Schrikkeljaar
conter 1 in binnary number
DB Search
6
divisão
asdcsadxasxd
4 Distinct Integer Custom Code Generator
shuffle2
Download a .NET assembly, and execute a static, parameterless method.
operator