Answer to 1 and 2 and 3 with the 4 choices. Which method do you invoke to: 1- cr
ID: 3790461 • Letter: A
Question
Answer to 1 and 2 and 3 with the 4 choices.
Which method do you invoke to:
1- create a list of strings called myStrings:
a - myNumbers.front();
b- myNumbers.addFront(15);
c- SLinkedList myStrings;
d- SLinkedList myNumbers;
2- add an integer 15 to the front of a singly linked list called myNumbers:
a - myNumbers.front();
b- myNumbers.addFront(15);
c- SLinkedList myStrings;
d- SLinkedList myNumbers;
3- return the front element of a singly linked list called myNumbers:
a - myNumbers.front();
b- myNumbers.addFront(15);
c- SLinkedList myStrings;
d- SLinkedList myNumbers;
1- create a list of strings called myStrings:
a - myNumbers.front();
b- myNumbers.addFront(15);
c- SLinkedList myStrings;
d- SLinkedList myNumbers;
2- add an integer 15 to the front of a singly linked list called myNumbers:
a - myNumbers.front();
b- myNumbers.addFront(15);
c- SLinkedList myStrings;
d- SLinkedList myNumbers;
3- return the front element of a singly linked list called myNumbers:
a - myNumbers.front();
b- myNumbers.addFront(15);
c- SLinkedList myStrings;
d- SLinkedList myNumbers;
Explanation / Answer
1. c- SLinkedList myStrings;
To create a list of strings called myStrings the object myStrings of class SLinkedList is used;
2. b- myNumbers.addFront(15);
To add an integer 15 to the front of a singly linked list called myNumbers , the object myNumbers is used to invoke method addFront(15). The method will add the integer 15 to the front of the linked list myNumbers.
3. myNumbers.front();
To return the front element of a singly linked list called myNumbers, the front() is invoked by myNumbers object of class SLinkedList.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.