Homework HW 1206 COSC 311 FALL 2017 Distributed: 12/6/2017 Due: 12/12/2017 Search in 2D array Given a square array, n X n, where each row is sorted and each column is sorted, design and implement an O(n) algorithm to determine if x is present. Return true if x is present, return false if x is not present. Entries in the array may be repeated. Example array: { { 10, 20, 20, 30} { 11, 22, 23, 31} { 12, 30, 30, 50} { 12, 31, 32, 60} } The array and target element x may be hardcoded. Execute your program on the following three problems. Only the data values may differ between your runs (e.g., your program should handle any size n of the array). Array: Find element 24 (false) { { 10, 20, 20, 30} { 11, 22, 23, 31} { 12, 30, 30, 50} { 12, 31, 32, 60} } Array: Find element 30 (true) { { 10, 20, 20, 30} { 11, 22, 23, 31} { 12, 30, 30, 50} { 12, 31, 32, 60} } Array: Find element 12 (true) { { 1, 2, 3, 3, 4, 5} { 2, 4, 8, 12, 13, 31} { 3, 4, 12, 30, 30, 50} { 12, 31, 32, 60, 90, 92} { 12, 31, 32, 90, 100, 120} { 31, 31, 90, 90, 120, 120} } Constraints: Name and URL in the file header Minimal comments Turn in: Hard copy of code (on one of the problem sets) Runs for all problem sets Grade based on: Correct result O(n) algorithm Satisfying constraints Elegant/readable code