Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Read the following code segment carefully and fill in blank #2. Read the documentation in the Pre/Post conditions carefully. void SortedType::DeleteItem(ListItemType& item) // Pre: List

Read the following code segment carefully and fill in blank #2.

Read the documentation in the Pre/Post conditions carefully.

void SortedType::DeleteItem(ListItemType& item)

// Pre: List contains valid data and List is sorted by key using

// function ComparedTo.

// 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.

// List is still sorted.

{

int location = 0;

int index;

bool moreToSearch;

moreToSearch = ______________; // 1

bool found = false;

while ( !found && _____________) // 2

{

switch (item.ComparedTo(info[location]))

{

case LESS : location++

moreToSearch = ______________________; // 3

break;

case GREATER : moreToSearch = ___________________; // 4

break;

case EQUAL : ________ = true // 5

break;

}

}

if (found)

{

for (index = location + 1; index < length; index++)

info[index - 1] = ______________; // 6

length--;

}

A) moreToSearch

B) !moreToSearch

C) None of these answers is correct.

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_2

Step: 3

blur-text-image_3

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

Discuss the impact of technology on marketing research AppendixLO1

Answered: 1 week ago

Question

Will formal performance reviews become obsolete? Why or why not?

Answered: 1 week ago

Question

Explain the key areas in which service employees need training.

Answered: 1 week ago

Question

Understand the role of internal marketing and communications.

Answered: 1 week ago