Question
Which of the following correctly fills the blank in the line labeled //6? void UnsortedType::DeleteItem(ListItemType& item) // Pre: List contains valid data. // There is
Which of the following correctly fills the blank in the line labeled //6?
void UnsortedType::DeleteItem(ListItemType& item)
// Pre: List contains valid data.
// There is at most one list item with the same key as item; there may
// be none.
// Post: No list element has the same key as item.
{
int location = 0;
int index;
bool moreToSearch;
moreToSearch = ______________; // 1
bool found = false;
while ( ! found && _____________) // 2
{
switch (item.CompardTo(info[location]))
{
case LESS : location++
moreToSearch = ______________________; // 3
break;
case GREATER : location++
moreToSearch = ______________________; // 4
break;
case EQUAL : ________ = true // 5
break;
}
}
if (found)
{
info[location] = ______________; // 6
length--;
}
}
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