How would unencapsulate an unsorted array structure’s fetch algorithm?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dseals22
    New Member
    • Jan 2017
    • 74

    How would unencapsulate an unsorted array structure’s fetch algorithm?

    Here is a sample of my code to help better understand the question. Any suggestions would be nice. When it says unencapsulate the structure, does it mean that I will reveal the implementation details of the deepCopy() method. Referring to specifically line 7 as the question in hand which is return data[i].deepCopy(); Here is partial code below:

    Code:
    //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();
Working...