Karbo
Čuven
- Učlanjen(a)
- 07.11.2004
- Poruke
- 448
- Poena
- 645
Moja oprema
- Pristup internetu
- Modemska 56k veza
Task 4: (3 marks) The following is a non-recursive algorithm. Please fill in the blanks.
Algorithm searchBST (root <node pointer>, target <key type>)
Purpose: This algorithm searches for a node in a binary search tree
Pre: root is a pointer to the root of a binary search tree;
target is the key of the node to be searched for
Return: pointer to the target node if target is found, NULL if not found
Begin
Set _________ //0.5 marks
while (__________________________) //1 mark
if (target < searchPtr->data.key)
_______________________ //0.5 marks
else
_______________________ //0.5 marks
endif
endwhile
return __________ //0.5 marks
End searchBST
Jel moze neko da mi pomogne da dopunim izostavljene rijeci/dijelove!?