Question
(1) To remove a specified entry of a bag that is implemented with a linked chain, first get a reference to the node to remove,
(1) To remove a specified entry of a bag that is implemented with a linked chain, first get a reference to the node to remove, then the most efficient approach is to:
a) move the data in the first node to the referenced node , then remove the first node
b) search through the chain again and find the previous node, have its next reference jump over the node to remove
c) shift the nodes down in reverse order
d) move the data in the last node to the referenced node , then remove the last node
(2)
Which bag behavior(s) would need to be modified when implementing a set?
(for this problem, answer can be more than 1.)
a) add()
b) clear()
c) contains()
d) toArray()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started