Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer all of the following questions. Point for each question is mentioned at the right margin 4+6 1. Write a recursive method to conduct binary
Answer all of the following questions. Point for each question is mentioned at the right margin 4+6 1. Write a recursive method to conduct binary search on a given array. Show how the algorithm works by simulating a step-by-step search of the item 25 in the following array: [2,8, 11, 17, 21, 25, 32, 39 2. For the given array, simulate the working operation of Merge Sort. Show your work 5+5 at each step. In particular, show how the array will be divided, and then how the results will be merged. [ 28, 13, 22, 7, 34, 2, 15, 18] For the same array as above simulate the working operation of Selection Sort. (Note: Show only the major operation 2+3 3. You are given the following set of vertices V and set of edges E of an unweighted directed graph G VG) = {A, B, C, D, E, F) EG) = {(A,B), (B, C, C,B),(C,D), (D, A), D, E), E, A), E, B); i. Draw the graph ii. Write down the adjacency matrix and adjacency list representation of the graph 4. 5 For each of the following algorithms or operations on data structures, mention the worst-case running time in asymptotic (big-0) notation. Justify your answer briefly. a) Searching an item in a binary search tree b) Inserting an item into a sorted array c) Sorting witems using bubble sort
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started