Computers and Technology
25.02.2020 16:03
148
196
4
Solved by an expert

Note: A pair is a simple struct with two data members, one of type T1 and one of

Note: A pair is a simple struct with two data members, one of type T1 and one of type T2. A set and a map are organized as binary search trees; anunordered_set and an unordered_map are organized as hash tables that never allow the load factor to exceed some constant, and a loop that visits every item in a hash table of N items is O(N).

Suppose UCLA has C courses each of which has on average S students enrolled. For this problem, courses are represented by strings (e.g. "CS 32"), and students by their int UIDs. We will consider a variety of data structures, and for each determine the big-O time complexity of the appropriate way to use that data structure to determine whether a particular student s is enrolled in course c. For example, if the data structure were vector>>, where each pair in the outer vector represents a course and all the students in that course, with those students being sorted in order, then if the pairs are in no particular order in the outer vector, the answer would be O(C + log S). (The reason is that we'd have to do a linear search through the outer vector to find the course, which is O(C), and then after that do a binary search of the S students in the sorted vector for that course, which is O(log S).) In these problems, we're just looking for the answer; you don't need to write the reason.

e. unordered_map>. What is the big-O complexity to determine whether a particular student s is enrolled in course c?

f. Suppose we have the data structure map> and we wish for a particular course c to write the id numbers of all the students in that course in sorted order. What is the big-O complexity?

g. Suppose we have the data structure unordered_map> and we wish for a particular course c to write the id numbers of all the students in that course in sorted order (perhaps using an additional container to help with that). What is the big-O complexity?

h. Suppose we have the data structure unordered_map> and we wish for a particular student s to write all the courses that student is enrolled in, in no particular order. What is the big-O complexity?
Show Answers
raquelle66
raquelle66
4,4(88 marks)

here's you go friend (-:

Explanation:

There are so many trouble spots in Africa that it's difficult to understand where U.S. foreign policy should start. American forces already intervene in the Horn of Africa and Niger. Meanwhile, French troops take the point on more recent conflicts and uprisings in West African countries, like Mali. But that's not all. Fighting in the area known as the Congo has been ongoing for decades. Africa is not the center of any geopolitical struggle like the Middle East is. African "Big Man" politics have not traditionally welcomed Western outsiders dictating their next courses of action โ€“ and when they did, it was usually to make a power play for money or arms against a superpower's rival. The best course of action is for outsider to form unified support for the African Union and give that organization real teeth.

(you can shorten it if you want)

Popular Questions about the subject: Computers and Technology

You are like a transmitter that can be shut off. when you no...
Computers and Technology
10.01.2020 23:17
Check the image, wrong or improper answers will be deleted...
Computers and Technology
12.04.2020 12:07
When using the common internet file system (cifs), which security...
Computers and Technology
21.11.2021 09:16
Complete the method definition to output the hours given minutes....
Computers and Technology
30.07.2022 22:14
Apie slice is a data marker that represents from a data series....
Computers and Technology
05.12.2020 21:43
Amber wants to export her animated movie in a file format that...
Computers and Technology
13.07.2020 01:56

New questions by subject

3. find the radius of circle p.4. find y....
Mathematics
28.05.2022 21:14
Given f(x) = 10x + 4 and g(x) = 3x - 8, what is f(x) + g(x)...
Mathematics
28.12.2022 06:52
Which equation can be used to solve for the unknown number?...
Mathematics
21.03.2023 02:28
#
#
#
#
# #

We expand our knowledge with many expert answers