Question: Fill in the missing piece of code 9 class OrdArray WithCollections 10 // cef to arraya 12 /private long[] a; 13 14 15 private List

 Fill in the missing piece of code 9 class OrdArray WithCollections

Fill in the missing piece of code 9 class OrdArray WithCollections 10 // cef to arraya 12 /private long[] a; 13 14 15 private List a; private int nElems; // number of data items public OrdArray_WithCollections (int max) // constructon 17 new ArrayList(); // create array 19 20 21 a = 23 public int size() 24 25 26 11 311 27 public int find (Long searchKey) 28 29 30 31 32 return nElems; int lowerBound = 0; int upperBound- nElems-1; int curIn; while(true) 34 35 36 37 38 39 40 41 42 43 curIn // if(a[curIn]--searchKey) if(a.get (curIn).equals(searchKey return curIn; /I found it else if(lowerBoundupperBound) // can't find it // divide range return nElems; else 45 46 47 48 49 50 51 52 53 54 //if (a[curIn]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!