Welcome! Log In Create A New Profile

Advanced

Ass4 Question7

Posted by ROtti 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Ass4 Question7
August 05, 2009 12:41PM
"The Findkth() function returns the kth highest element in a binary search tree."


What do they mean the kth HIGHEST?

- the kth biggest number?
- or the kth highest in the tree? there kan be more than one.
- looks like no parameters passed in. Findkth()
- I'm confused.

anyone?
avatar Re: Ass4 Question7
August 05, 2009 01:43PM
Language: C++
template<class elemType> int SearchTreeType<elemType>::Findkth() { //your code goes here //.. //... return kth //where kth is the variable that contains the info of the biggest node }

NB! The node containing the biggest info will always be on the left subtree (child)

smile
avatar Re: Ass4 Question7
August 05, 2009 03:19PM
Reply from lecturer :

Hi
No. The function shout take some parameter. You need a way of telling the function what kth  element it should return.
 
Regards,
Masombuka KT
Sorry, only registered users may post in this forum.

Click here to login