Question: thats the full question Reax CS2 C Writx Test X Find X F Grox F Arx You X u/0/c/MTk2OTgyNDQyMjc0/a/Mjg 1NDk2MjMyNDA1/details Co Apply for a U.S.

thats the full question Reax CS2 C Writx Test X Find XF Grox F Arx You X u/0/c/MTk2OTgyNDQyMjc0/a/Mjg 1NDk2MjMyNDA1/details Co Apply for athats the full question

Reax CS2 C Writx Test X Find X F Grox F Arx You X u/0/c/MTk2OTgyNDQyMjc0/a/Mjg 1NDk2MjMyNDA1/details Co Apply for a U.S. Vis. USA Visitor Visa Ap.. WCO CWC. Ashoka Unive... P https://piazza.com/ ca Learning M 3 CS-1205 Test 1 the sequence 1, 1+1,...,,.., 1-1 is sorted in increasing order.An example of a cyclically sorted array is (10,29,33. 111, 2.3, 6, 7). Give pseudocode for an O(log n) algorithm to find the position of the minimal element in the list, assuming that this position is unique. Problem -7. [15 points) Ubhash Sallabh leads a team of social Yreis. Each Yrei has a unique name: a string of at most k lowercase English letters. Each pair of Yreis has at most two buddyghost names formed by the concatenations of their names in either order (note it is possible for a pair of Yreis to have only one buddyghost name if both concatenations are the same). Four Yreis are buddyghost buddies if a buddyghost name of two of them is identical to a buddyghost name of the other two. For example, Yreis 'alex', 'isabel', 'alexis', and 'abel' are buddyghost buddies. Given a list A = (a..... (n.) containing the names of Ubhash's n Yreis, describe an O(kn)-time algorithm to determine whether any four of them are buddyghost buddies. (hint: make use of (a) data structure(s) you learnt in class, assume that string operations such as concatenation etc, take you only an expected O(1) time.) Problem -8. [25 points] A two-dimensional n x m matrix A is two-dimensionally sorted if every row and column is sorted in increasing order rightward and downward: in other words, A [2] > A[y][x - 1) and Alyle > A[y-112] whenever those indices are in range. For example, the matrix below is two-dimensionally sorted. A- [[ 1, 3, 7 8, 161, 2, 3, 8, 13, 17 l. 4. 5, 14, 15, 21 l. 18, 17, 17, 21, 23). [11, 17, 24, 26, 30 31 The SORTED2DSEARCH problem asks, given a two-dimensionally sorted array A and integer 1, does the value v appear as an element of A? (a) [5 points) Checking every element of the array against u solves this problem in O(nm) time. Describe an algorithm that uses binary search to solve SORTED 2DSEARCH in On log m) time. (In the following parts, you'll design and implement a linear time Problem -7. [15 points) Ubhash Sallabh leads a team of social Yreis. Each Yrei has a uni name: a string of at most k lowercase English letters. Each pair of Yreis has at most buddyghost names, formed by the concatenations of their names in either order (note it is poss for a pair of Yreis to have only one buddyghost name if both concatenations are the same). E Yreis are buddyghost buddies if a buddyghost name of two of them is identical to a buddyg name of the other two. For example, Yreis 'alex', 'isabel', 'alexis', and 'abel' buddyghost buddies. Given a list A = (aj...., an) containing the names of Ubhash's n Y describe an O(kn?)-time algorithm to determine whether any four of them are buddyg buddies. (hint: make use of [a] data structure[s] you learnt in class; assume that string operati such as concatenation etc, take you only an expected (k) time.) Reax CS2 C Writx Test X Find X F Grox F Arx You X u/0/c/MTk2OTgyNDQyMjc0/a/Mjg 1NDk2MjMyNDA1/details Co Apply for a U.S. Vis. USA Visitor Visa Ap.. WCO CWC. Ashoka Unive... P https://piazza.com/ ca Learning M 3 CS-1205 Test 1 the sequence 1, 1+1,...,,.., 1-1 is sorted in increasing order.An example of a cyclically sorted array is (10,29,33. 111, 2.3, 6, 7). Give pseudocode for an O(log n) algorithm to find the position of the minimal element in the list, assuming that this position is unique. Problem -7. [15 points) Ubhash Sallabh leads a team of social Yreis. Each Yrei has a unique name: a string of at most k lowercase English letters. Each pair of Yreis has at most two buddyghost names formed by the concatenations of their names in either order (note it is possible for a pair of Yreis to have only one buddyghost name if both concatenations are the same). Four Yreis are buddyghost buddies if a buddyghost name of two of them is identical to a buddyghost name of the other two. For example, Yreis 'alex', 'isabel', 'alexis', and 'abel' are buddyghost buddies. Given a list A = (a..... (n.) containing the names of Ubhash's n Yreis, describe an O(kn)-time algorithm to determine whether any four of them are buddyghost buddies. (hint: make use of (a) data structure(s) you learnt in class, assume that string operations such as concatenation etc, take you only an expected O(1) time.) Problem -8. [25 points] A two-dimensional n x m matrix A is two-dimensionally sorted if every row and column is sorted in increasing order rightward and downward: in other words, A [2] > A[y][x - 1) and Alyle > A[y-112] whenever those indices are in range. For example, the matrix below is two-dimensionally sorted. A- [[ 1, 3, 7 8, 161, 2, 3, 8, 13, 17 l. 4. 5, 14, 15, 21 l. 18, 17, 17, 21, 23). [11, 17, 24, 26, 30 31 The SORTED2DSEARCH problem asks, given a two-dimensionally sorted array A and integer 1, does the value v appear as an element of A? (a) [5 points) Checking every element of the array against u solves this problem in O(nm) time. Describe an algorithm that uses binary search to solve SORTED 2DSEARCH in On log m) time. (In the following parts, you'll design and implement a linear time Problem -7. [15 points) Ubhash Sallabh leads a team of social Yreis. Each Yrei has a uni name: a string of at most k lowercase English letters. Each pair of Yreis has at most buddyghost names, formed by the concatenations of their names in either order (note it is poss for a pair of Yreis to have only one buddyghost name if both concatenations are the same). E Yreis are buddyghost buddies if a buddyghost name of two of them is identical to a buddyg name of the other two. For example, Yreis 'alex', 'isabel', 'alexis', and 'abel' buddyghost buddies. Given a list A = (aj...., an) containing the names of Ubhash's n Y describe an O(kn?)-time algorithm to determine whether any four of them are buddyg buddies. (hint: make use of [a] data structure[s] you learnt in class; assume that string operati such as concatenation etc, take you only an expected (k) time.)

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!