Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You have two sorted lists of integers, Li and L2. You know the lengths of each list, Li has length Ni and L2 has length
You have two sorted lists of integers, Li and L2. You know the lengths of each list, Li has length Ni and L2 has length N2. (a) Design an efficient algorithm (only pseudocode) to output a sorted list Lin L2 (the intersection of Li and L2). (b) If you know that N2 > N1. What is the running time complexity of your algorithm? Justify. Important Note: For this problem, you don't need to submit any implementation in Java. Only the pseudocode of your algorithm is required. Pseudocode is a simple way of writing programming code in English. It uses short phrases to write code for programs before you actually create it in a specific language. Example of pseudocode: Set total to zero Set grade counter to one While grade counter is less than or equal to ten Input the next grade Add the grade into the total Set the class average to the total divided by ten Print the class average
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