B) Which of the following ADTs are provided in stl as a template class. That is,
ID: 3910362 • Letter: B
Question
B)
Which of the following ADTs are provided in stl as a template class. That is, which of the ADTs can be used right out-of-the-box, without adding much or any code.
[Note: I am asking about stl, not some 3rd party or other library. It has to be in stl in some form that is essentially a general implementation of the requested ADT. It's okay if the stl version does more, as long as it can be used to handle the ADT without lots of extra code.]
Example. stl has a Deque interface. Even though this does more than the ADT queue, it is good enough: We would check this box.
General Tree Select the maximum flow (based on standard graph theory definitions) from s to t in the following directed graph, whose edge costs are clearly labeled: 1 2 units 3 units 4 units 0 5 units 6 units 7 unitsExplanation / Answer
A) In A part consider the 3 paths. From the left path the maximum flow that can be sent will be the minimum of the 3values ie. minimum of (1,1,1). So the flow will be 1.
In the middle path the maximum flow will be 4 as there is only one path.
In the right path the minimum of (1,2,2)=1 so the maximum flow will be 1.
Overall maximum flow = 1+1+4=6
B) Stack is inbuilt in stl use the keyword stack to initialize stack
priority queues are also inbuilt can be accessed by the keyword priority_queue
Linked List can be accessed by the keyword list.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.