Question: Class UnsortedType{ public: //all the prototypes go here. private: int length; NodeType* listData; }; void UnsortedType::DeleteItem(ItemType item) // Pre:Item is in list NodeType* tempPtr;// pointer

Class UnsortedType{ public: //all the prototypes go here.

private: int length; NodeType* listData; };

void UnsortedType::DeleteItem(ItemType item)

// Pre:Item is in list

NodeType* tempPtr;// pointer delete

NodeType* predLoc;// trailing pointer

NodeType* location; // traveling pointer

bool found = false;

location = listData;

predLoc = _____________; // 20

length--;

// Find node to delete.

while (____________) ; // 21

{

switch (__________________) ; // 22

{

case GREATER:

case LESS : predLoc = location;

location = ___________; // 23

break;

case EQUAL : found = ___________; // 24

break;

}

}

// delete location

tempPtr = _____________; // 25

if (____________) // 26

____________ = location->next; //27

else

predLoc->next = _____________; //28

delete tempPtr;

}

Read the code segment above and fill in blank # 20.

A. NULL B. True C. false D. listData E. answer not shown

Read the code segment above and fill in blank # 21. A. true B. !found C. false D. moreToSearch E. answer not shown

Read the code segment above and fill in blank # 22.

A. item.ComparedTo(listData->info) B. item.ComparedTo(location->next) C. item.ComparedTo(location->info) D. item.CompareedTo(location) E. answer not shown

Read the code segment above and fill in blank # 23. A. item B. *location.next C. (*location).next D. predLoc E. answer not shown

Read the code segment above and fill in blank # 24. A. false B. true C. predLoc == NULL D. location != NULL E. answer not shown

Read the code segment above and fill in blank # 25. A. preLoc B. location C. predLoc->next D. location->next E. answer not shown

Read the code segment above and fill in blank # 26. A. predLoc == NULL B. location == NULL C. predLoc == location D. predLoc->next == NULL E. answer not shown

Read the code segment above and fill in blank # 27. A. predLoc B. location C. location->next D. listData E. answer not shown

Read the code segment above and fill in blank # 28. A. listData B. predLoc->next C. location->next D. newNode->next E. answer not shown

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!