Re: Re: I want Max to Min
Quote:
Originally posted by Marc G
You cannot expect order when you do not want to sort.
Many people expect order from a binary tree without a sort ever being needed. It is very possible to create an array that is in a specified order without ever sorting it.
Re: Re: Re: I want Max to Min
Quote:
Originally posted by Sam Hobbs
Many people expect order from a binary tree without a sort ever being needed. It is very possible to create an array that is in a specified order without ever sorting it.
But the point of a binary tree is that the sorting happens during insertion of elements... IOW it is sorted, but there's no explicit sort() command, since it's always maintained in a sorted state.
Re: Re: Re: Re: I want Max to Min
Quote:
Originally posted by Graham
But the point of a binary tree is that the sorting happens during insertion of elements... IOW it is sorted, but there's no explicit sort() command, since it's always maintained in a sorted state.
Correct. The elements are not sorted, and my comment was a reply to something saying that data maut be sorted to be printed in order. For each element inserted into a binary tree, the tree is searched but not sorted. As you say, it is not sorted, but the binary tree is built in a sorted order.
Re: Re: Re: I want Max to Min
Quote:
Originally posted by Sam Hobbs
Many people expect order from a binary tree without a sort ever being needed. It is very possible to create an array that is in a specified order without ever sorting it.
Can you just give us a snippet to make what you said clearer ?
If there is no evidence but so much reasoning, I think all are just like waste, they are all unbelievable ?
Thanks a lot,
Regards,
homestead
Giving the question again?
Hi all,
Thank u all for ur responses.
I am giving my question again...
I have an array and without modifying that array(without sorting)
and without using another array, I have to print the elements from Max to Min (descending order..).
Please help me out with some hints...
Thanks in advance,
Koti Reddy