Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions