Advertisement
absorr

Lesson 51

Feb 27th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. //QUESTION 1
  2. // 4
  3.  
  4. //QUESTION 2
  5. // 7, 10, 13
  6.  
  7. //QUESTION 3
  8. // It needs to be sorted
  9.  
  10. //QUESTION 4
  11. lb = mid + 1;
  12. ub = mid - 1;
  13.  
  14. //QUESTION 5
  15. Double dw[] = new Doubles[dd.length];
  16. for (int i; i<dd.length; i++)
  17.     dw[i] = dd[i];
  18.  
  19. //QUESTION 6
  20. // No issues
  21.  
  22. //QUESTION 7
  23. // O(log(n))
  24.  
  25. //QUESTION 8
  26. // O(n)
  27.  
  28. //QUESTION 9
  29. // It is possible depending on the index of the value
  30.  
  31. //QUESTION 10
  32. // 1
  33.  
  34. //QUESTION 11
  35. // n
  36.  
  37. //QUESTION 12
  38. // binary
  39.  
  40. //QUESTION 13
  41. // Linear because binary requires it to be sorted.
  42.  
  43. //QUESTION 14
  44. if (Arrays.binarySearch(dd, 107.3) != -1)
  45.     System.out.println("Hubba hubba");
  46.  
  47. //QUESTION 15
  48. // 16 and 17
  49.  
  50. //QUESTION 16
  51. // Yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement