Thats some really cool furniture. The way the desks and surfaces balance when flipped is really neat , don't see that kind of innovative thinking in furniture too often.
not entirely sure what he's doing with the INT_MIN and INT_MAX . But a better solution would be to use one of the tree values (the root ?) as a starting point and then compare the remaining elements to that value . That way you don't have to worry about negative numbers.
why are you traversing the left subtree for getMax?.
why are you traversing the right subtree for getMin?.
What is the difference between initializing maxVal to 0 and initializing it to item ?.
Will this work if there are negative numbers in the tree ?.
What if you want to find the highest...
If its a binary tree then the biggest number is the right most node and the smallest number is the left most node, so just keep going right or left respectively. Theres a trick to stopping it though.
you dont need to check the left sub tree if you're looking for the biggest number ...
@starBob : In a balanced tree every time you choose the left or right sub tree you are effectively dividing the search space by 2 , thus giving you the nice logarithmic run time. For example if i'm searching for a value which is bigger than the root element i can completely ignore the left sub...
problems like this are a LOT more interesting than the stuff i have to code on a day to day basis.
@starBob : A binary tree is a data structure in which data is ordered according to its size, so it optimizes certain tasks like finding the highest or lowest piece of data (keep things generic) in...
which you can further simplify to
int GetSize(BinaryTreeNode* root)
{
return (root==null)?0:1 + (root->left==null)? 0:GetSize(root->left) + (root->right==null)? 0:GetSize(root->right);
}
.
yeah i'm being silly.
the height of the tree is the max of the heights of the left and the right. This is assuming that you're talking about binary trees. so what you need to do is apply this case to each node. It will probably look something like this if done recursively.
NOTE : This is not C , but you get the gist...
i'm pretty sure the new resizing tools in the latest Adobe Creative Suite could resize this without a loss of quality (Automagically). but thats a long shot.
buying them online is your best bet. If you can deal with international versions try http://www.abebooks.com the books are printed in english but they're softcovers. ABE also has regular U.S editions.
edit:Most universities also have classified listings where students list used books.
Either get a laptop back pack with a special compartment to separate your books form your laptop. or get one of those padded sleeves. Books can easily **** up your laptop depending on the make and how much you stuff in there.
True but it isn't out of ignorance, we only really have one shot to get it right with these sorts of things. So would you rather explore a planet which has water or one which doesn't ?.