subject

Consider two lists of numbers called list1 and list2. A programmer wants to determine how many different values appear in both lists. For example, if list1 contains [10, 10, 20, 30, 40, 50, 60] and list2 contains [20, 20, 40, 60, 80], then there are three different values that appear in both lists (20, 40, and 60).
The programmer has the following procedures available.
Procedure Call Explanation
Combine (myList1, myList2) This procedure creates a new list containing the elements from myList1 followed by the entries from myList2. The resulting
list is returned. For example, if myList1 contains [2, 4, 6] and
myList2 contains [1, 5], the procedure will return the list
[2, 4, 6, 1, 5].
RemoveAllDups (myList) This procedure creates a new list containing the elements of myList with any duplicate values removed. The resulting list is returned. For
example, if myList contains [3, 2, 4, 2, 2, 5, 6, 4],
the procedure will return the list [3, 2, 4, 5, 6].
Which of the following can be used to assign the intended value to count ?
answer choices
bothList ← Combine (list1, list2)
uniqueList ← RemoveAllDups (bothList)
count ← LENGTH (bothList) - LENGTH (uniqueList)
newList1 ← RemoveAllDups (list1)
newList2 ← RemoveAllDups (list2)
bothList ← Combine (newList1, newList2)
count ← LENGTH (list1) + LENGTH (list2) - LENGTH (bothList)
newList1 ← RemoveAllDups (list1)
newList2 ← RemoveAllDups (list2)
bothList ← Combine (newList1, newList2)
count ← LENGTH (newList1) + LENGTH (newList2) - LENGTH (bothList)
newList1 ← RemoveAllDups (list1)
newList2 ← RemoveAllDups (list2)
bothList ← Combine (newList1, newList2)
uniqueList ← RemoveAllDups (bothList)
count ← LENGTH (bothList) - LENGTH (uniqueList)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Ahorse is how much percent more powerful than a pony
Answers: 1
question
Computers and Technology, 22.06.2019 08:00
Apex q: what does a low employment rate indicate? a. not many people are earning high salaries b. not many people are going to college c. not many people are renting their homes d. not many people have jobs
Answers: 2
question
Computers and Technology, 24.06.2019 16:30
Which program can damage your computer?
Answers: 1
question
Computers and Technology, 24.06.2019 18:00
Why is a multiview sketch drawinf different from other sketches like isometric, two point, and oblique
Answers: 1
You know the right answer?
Consider two lists of numbers called list1 and list2. A programmer wants to determine how many diffe...
Questions
question
Social Studies, 25.02.2021 05:50
question
Biology, 25.02.2021 05:50
question
Mathematics, 25.02.2021 05:50
question
Mathematics, 25.02.2021 05:50
Questions on the website: 13722362