Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CSC300 Final [Read-Only] ·Microsoft word (Product Activation Failed) eview View

ID: 3722491 • Letter: C

Question

CSC300 Final [Read-Only] ·Microsoft word (Product Activation Failed) eview View :i . ··11 1Normal-No spacing Heading , Heading 2 Heading j titte Soette subtle Paragraph Multiple Choice Questions 1. Which statement is correct about adding a node to a linked list? a) You cannot add a new node in a linked list after the linked list is created. b) You can add a node anywhere in a linked list c) You can add a node only at the beginning of a linked list. d) You can add a node only at the end of a linked list. 2. How can you locate the fifth node in a doubly-linked list named invoices? a) invoices (51 b) invoices [4] c) Start at the first node and follow pointers to the next node in the list untilthe fifth node is located d) None of the listed options. 3. blem with the following code snippet, which is attempting to locate the first element What is the pro in the list names? listsstring> names: a) b) c) d) string first = names [1]; The first element will be located by using names [0) It is not legal to use the [1 operator withalist object. You need to first check that the size of names is at least 2. There is no problem with the code snippet.

Explanation / Answer

Please find below answers <questionNo>. (<correctAnswer>) and explanations

1. (b)
Explanation:
Linked allowed to insert the node at any where it can be top ,bottom or in between of need
so like it also allows deletion of nodes from anywhere same as adding the node.

2). (c)
linked not allows to access elements using indexing as like in arrays.
in order the access the node start from first and using next link find the required node.

3). (a)
list is the based on array based index which starts from 0 so in order to access
first item names[0] will be the way.

4. (b)
as numarray[6] is the array of 6 elements means start index is 0 and last index is 5
but in for loop value of cnt is initialize with 1 means index 0 that is first element will
not initialized.

5. (b)
this is the inheritence based in which Car is the parent class and AeroCar is the child class which
means AeroCar object have access of all the methods define in class Car and of course in his class methods.
But Car class object can access the his class method only.
so now you understand that in first option car is calling get_height() method which is define
in subclass so it will not have visibility.