Question: Problem 1 (5 points) Suppose you have two binary numbers represented by linked lists. Each node in the list contains a single digit such that

Problem 1 (5 points) Suppose you have two binary numbers represented by linked lists. Each node in the list contains a single digit such that the 1's digit is stored at the head of the list. Write a function -- ADD(list 11, list (2) that takes two binary numbers 11 and 12 as input, adds the two numbers, and returns a new list that contains the sum. For example, list 11 = 0 -> 1 and list 12 = 1 ->0->1 must return a new list containing 1 -> 1->1. Analyze the time complexity of your algorithm. Assume that lists 11 and 12 are of sizes m and n respectively. (5 points) Problem 1 (5 points) Suppose you have two binary numbers represented by linked lists. Each node in the list contains a single digit such that the 1's digit is stored at the head of the list. Write a function -- ADD(list 11, list (2) that takes two binary numbers 11 and 12 as input, adds the two numbers, and returns a new list that contains the sum. For example, list 11 = 0 -> 1 and list 12 = 1 ->0->1 must return a new list containing 1 -> 1->1. Analyze the time complexity of your algorithm. Assume that lists 11 and 12 are of sizes m and n respectively. (5 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
