Answer:
The answer is "Option d".
Explanation:
In the above-given code, two-class is defined that is "employee and manager", in which the first class "employee" defines two variables that are "name, id". In this name is pointer type character and id is a long type variable.
In the second class "manager" one variable "rank" and the employee object is created. In this class, the rank variable is a pointer type character, and outside this class, a reference "x" is created.
In this code, we use both class object that uses the "employee" class variable that is id to hold value in it.
Answer:
The answer is "O(n2)"
Explanation:
The worst case is the method that requires so many steps if possible with compiled code sized n. It means the case is also the feature, that achieves an average amount of steps in n component entry information.
- In the given code, The total of n integers lists is O(n), which is used in finding complexity.
- Therefore, O(n)+O(n-1)+ .... +O(1)=O(n2) will also be a general complexity throughout the search and deletion of n minimum elements from the list.
Answer:
The top three winners are
Jody, the Giant
Buffy, the BarbarianAdelle, the Alligator
Answer:
size = int(input("How many names will be there? "))
names = []
for _ in range(0, size):
name = input("Enter a name: ")
names.append(name)
names.sort()
print(names[0] + " " + names[-1])
Explanation:
* The code is in Python
- Ask the user for the number of the name
- Initialize an empty list that will hold the name entered
- Inside the for loop, get the names and put them in the names array
- When all the names are entered, sort them and print the first and last of the name