Question: Help for question 2 please. Question 1 is done. 1) Develop well-documented pseudo code that finds all the elements of a given array (of any

Help for question 2 please. Question 1 is done.

Help for question 2 please. Question 1 is done. 1) Develop well-documented

1) Develop well-documented pseudo code that finds all the elements of a given array (of any size n) that are multiple ofx. The code must display the indices and the values of these elements. For instance, given an array A (22, 61,-10, 21, 0, 9, 50, 17, 35, 81,-46, 19, 5, 77) with x as 5, your code should find and display something similar to the following (notice that this is just an example. Your solution must not refer to this particular example): The elements of the aray A that are multiple of 5 are: Index 2 with value -10 Index 6 with value 50 Index 8 with value 35 Index 12 with value 5 a. Briefly justify the motive(s) behind your design. b. What is the Big-O complexity of your solution? Explain clearly how you obtained such c. What is he Big-2 complexity of your solution? Explain clearly how you obtained such d. What is the complexity complexity Big-O space complexity of your solution? 2) Develop a well-documented pseudo that solves the problem stated in part 1), using either a stack S or a queue Q to perform what is needed. a. Briefly justify the motive(s) behind your design b. What is the Big-0 complexity of your solution? Explain clearly how you obtained such complexity c. What is the Big-2 complexity of your solution? Explain clearly how you obtained such complexity What is the Big-O space complexity of the utilized stack or queue? Explain your answer d. 1) Develop well-documented pseudo code that finds all the elements of a given array (of any size n) that are multiple ofx. The code must display the indices and the values of these elements. For instance, given an array A (22, 61,-10, 21, 0, 9, 50, 17, 35, 81,-46, 19, 5, 77) with x as 5, your code should find and display something similar to the following (notice that this is just an example. Your solution must not refer to this particular example): The elements of the aray A that are multiple of 5 are: Index 2 with value -10 Index 6 with value 50 Index 8 with value 35 Index 12 with value 5 a. Briefly justify the motive(s) behind your design. b. What is the Big-O complexity of your solution? Explain clearly how you obtained such c. What is he Big-2 complexity of your solution? Explain clearly how you obtained such d. What is the complexity complexity Big-O space complexity of your solution? 2) Develop a well-documented pseudo that solves the problem stated in part 1), using either a stack S or a queue Q to perform what is needed. a. Briefly justify the motive(s) behind your design b. What is the Big-0 complexity of your solution? Explain clearly how you obtained such complexity c. What is the Big-2 complexity of your solution? Explain clearly how you obtained such complexity What is the Big-O space complexity of the utilized stack or queue? Explain your answer d

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!