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, 21.06.2019 22:00
What do the principles of notice, choice, onward transfer, and access closely apply to? a. privacyb. identificationc. retentiond. classification
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
Choose the best explanation for the following statement communication is symbolic
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
The initial tableau of a linear programming problem is given. use the simplex method to solve it. x 1 x 2 x 3 s 1 s 2 z 1 2 4 1 0 0 8 3 4 1 0 1 0 10 minus3 minus12 1 0 0 1 0 the maximum is nothing when x 1equals nothing, x 2equals nothing, x 3equals nothing, s 1equals3, and s 2equals0. (be sure to simplify to lowest terms if necessary.)
Answers: 2
question
Computers and Technology, 24.06.2019 13:20
3. ranga ramasesh is the operations manager for a firm that is trying to decide which one of four countries it should research for possible outsourcing providers. the first step is to select a country based on cultural risk factors, which are critical to eventual business success with the provider. ranga has reviewed outsourcing provider directories and found that the four countries in the table that follows have an ample number of providers from which they can choose. to aid in the country selection step, he has enlisted the aid of a cultural expert, john wang, who has provided ratings of the various criteria in the table. the resulting ratings are on a 1 to 10 scale, where 1 is a low risk and 10 is a high risk. john has also determined six criteria weightins: trust, with a weight of 0.3; quality, with 0.2; religious, with 0.1; individualism, with 0.2; time, with 0.1; and uncertainity, with 0.1. using the factor-rating method, which country should ranga select? why? (2 points)
Answers: 3
You know the right answer?
Consider two lists of numbers called list1 and list2. A programmer wants to determine how many diffe...
Questions
question
Mathematics, 07.01.2021 19:40
question
Mathematics, 07.01.2021 19:40
question
Biology, 07.01.2021 19:40
Questions on the website: 13722367