![]() |
| ||
| Binary Tree - Next Highest Value How can we find the next highest value in the binary tree? We have a binary tree and an number is being input. We need to find the next highest number. |
| ||
| Re: Binary Tree - Next Highest Value show us your code and we can help you out |
| ||
| Re: Binary Tree - Next Highest Value What will be the C# version of the below code. int findSuccessor(self): succ = None if self.rightChild: succ = self.rightChild.findMin() else: if self.parent.leftChild == self: succ = self.parent else: self.parent.rightChild = None succ = self.parent.findSuccessor() self.parent.rightChild = self return succ int findMin(self): n = self while n.leftChild: n = n.leftChild print 'found min, key = ', n.key return n |
| ||
| Re: Binary Tree - Next Highest Value please put the code in code tags do you have any of this done yourself in c# yet? |
| ||
| Re: Binary Tree - Next Highest Value I have not done this in C#.
|
| ||
| Re: Binary Tree - Next Highest Value then make an effort, and we will make an effort if you are having trouble with a specific piece, rather than just though whole thing then let us know, we won't do the work for you |
| ||
| Re: Binary Tree - Next Highest Value How can I start to convert the code in C# and test it? |
| ||
| Re: Binary Tree - Next Highest Value did you do it in python or is that some else's? here's a link that will give you a java version MAKE AN EFFORT http://simpleprogrammingtutorials.co...t-overview.php |
| ||
| Re: Binary Tree - Next Highest Value How will you write if self.rightChild: in C# |
| ||
| Re: Binary Tree - Next Highest Value in c# you have classes, think of it this way you have a node, and a node on the left and right each node is connected to another node (rightChild) and (leftChild) you can't just translate this code to c#, you need to think about what structure you need first |
| All times are GMT -4. The time now is 12:46 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC