Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
//access the node (assumes the node is in the structure)
i=0;
while(targetKey!=data[i].key()){
i++;
}

// return a a copy of the node to the client 
return data[i].deepCopy();


What I have tried:

I would think that to unencapsulate this I would have to expose the deepCopy()'s method implementation details, right?
Posted
Updated 16-Sep-17 12:26pm
v2

1 solution

Not your question, but your code is plain wrong.
What happen at end of array when the targetKey do not exist ?
 
Share this answer
 
Comments
Dorakta 16-Sep-17 18:18pm    
@ppolymorphe Do you think you can help? It's pseudocode; I just practice, but do you think you can still help?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900