Answer:
Explanation:
This program is written in Python. It is a function that takes in two arrays. Then it loops through the first array twice, adding each element with the others and comparing the sum to the values in the second array. If a similar value is found in the second array, the program prints out the value and returns True to the user. Otherwise, it returns False. A test case has been created with two array variables that print out False, the output can be seen in the attached image below.
def sumArray(arr1, arr2):
for i in range(len(arr1)):
for x in range(len(arr1)):
sum = 0
if i != x:
sum = arr1[i] + arr1[x]
if sum in arr2:
print(str(sum) + "Found in Second Array")
return True
return False
arr1 = [1, 9, 10, 44]
arr2 = [2, 4, 8, 14]
print(sumArray(arr1, arr2))
Answer:
just don't share your screen in the class or if your a teacher just call them out
Explanation:
Answer:
FALSE
Explanation:
Because C1 and C2 implement the same interface, they both implement whichIsIt. The variable c is known as a polymorphic variable, meaning that it can change from being an C1 to a C2. So, the message c.whichIsIt( ); may invoke C1's whichIsIt or C2's whichIsIt. This can only be known at runtime.
Answer:
Make use of hash tables
Explanation:
The appropriate thing to use for this should be a hash table.
A Hash Table can be described as a data structure which stores data in an associative manner. In a hash table, data is stored in an array format, where each data value has its own unique index value. Access of data becomes very fast if we know the index of the desired data. So we can perform Hashing on ISBN Number since its unique and based on the Hash Function w ecan store the Information record.
There is no requirement for printing the file in order - HashTables dont store the data in order of insertions, so no problems with that
It becomes a data structure in which insertion and search operations are very fast irrespective of the size of the data. So Querying books details can be fast and searching will take less time.
It can also be pointed out that it wont be too expensive for Hardware implemtation as HashTables stores data based on Hash Functions and memory consumption is also optimal which reduces memory wastages.