Question

Question 4 1 pts Which of the following is an edge in this graph? (select all that apply) 0 (4,5) O (3,5) O (2,4) (0,3) (3,1)Question 5 1 pts Given the following vector v, what will the final value of v be? std::vector<int> y = {6,4,81,99,17}; v.pop_Question 6 1 pts Given the following function header, the vector is passed by value. void addToVector(std::vector<int> v); Tr

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans 4: Edge in this graph from given options

(4,5)
(2,4)
(3,1)

=====================================================================================
Ans 5

// Write C++ code here
std::vector<int> v ={6,4,81,99,17};
v.pop_back(); //remove 17
v.pop_back(); //remove 99
  
v.push_back(32); //add 32 at end [6,4,81,32]
  
v.pop_back(); //remove 32
  
v.push_back(12); //add 12 at end [6,4,81,12]
  
v.pop_back(); //remove 12

v.push_back(18); //add 18 at end [6,4,81,18]

v.push_back(21); //add 21 at end [6,4,81,18,21]
  
v.pop_back(); //remove 21 [6,4,81,18]

Correct option is D

v = {6,4,81,18}

=====================================================================================
Ans 6

vector are passed by value in C++ unless specified by &.

Correct option is True

=====================================================================================

Add a comment
Know the answer?
Add Answer to:
Question 4 1 pts Which of the following is an edge in this graph? (select all...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT