What code can be added

Assignment Help Computer Engineering
Reference no: EM132155903

Use C++

The ADT UnsortedType List function ‘DeleteItem(ItemType item)' creates an endless loop error when trying to delete a word or key that is not in the list.

Example: Delete the word "letter" from the unsorted list.

Here are the lists contents before the DeleteItem(ItemType item) call:

super formula travel free thick Josephine Clara education

The question is ‘how can I exit gracefully from the DeleteItem(itemType Item) call when the word or key is not in the unsorted list and not get an endless loop but instead printing out a message that the word ‘letter' is not in the loop? What code can be added?

void UnsortedType::DeleteItem(ItemType item)

{

NodeType* location;

NodeType* tempLocation;

location = listData;

if (item.ComparedTo(location->info) == EQUAL)

{

tempLocation = location;

listData = listData->next;

}

else

{

while (!((item.ComparedTo((location->next)->info) == EQUAL)))

location = location->next;

tempLocation = location->next;

location->next = (location->next)->next;

}

delete tempLocation;

length--;

}

Reference no: EM132155903

Questions Cloud

A sample of 18 widgets has a mean : A sample of 18 widgets has a mean of 37.300 and standard division 8.150. At 99% confidence, the upper limit with 3 decimal places is?
To check a hamming code for a single-bit error : The program checks a Hamming code for a single-bit error based on choosing from a menu of choices.
Find the mean for the number of people : About 8% of the population has a particular genetic mutation. 900 people are randomly selected.
What is the probability that at least 3 of the 5 trees : What is the probability that at least 3 of the 5 trees that he measures are really Douglas-firs?
What code can be added : The ADT UnsortedType List function ‘DeleteItem(ItemType item)' creates an endless loop error when trying to delete a word or key that is not in the list.
Confidence interval for the true proportion : Construct a 95% confidence interval for the true proportion, mean, of Phantol users who got relief from using the drug.
How many would you expect to weigh between 3 and 8 pounds : The weights for newborn babies is approximately normally distributed with a mean of 5.5 pounds and a standard deviation of 1.1 pounds.
Modify the classify numbers programming : Data to the program is input from a file of an unspecified length; that is, the program does not know in advance how many numbers are in the file.
What is the efficiency rating : The expected value with no survey is $62,000 and the EVPI is $4,000. What is the efficiency rating?

Reviews

Write a Review

Computer Engineering Questions & Answers

  What advanced feature of password management tools

What advanced feature of password management tools requires a user to have a unique file on a separate storage device to open a password database

  Drawbacks of supporting links to files that cross mount

explain the advantages and disadvantages of supporting links to files that cross mount points (that is, the file link refers to a file that is stored in a different volume).

  The priority of the interrupts ranges from irq6 as the

given the following set of events show which routines the cpu is executing for times 0 to 100 ns.nbsp each handler

  Write a program to display the stages in the conversion

Write a program to display the stages in the conversion of an equilateral triangle into another shape, given a set of geometric-substitution rules.

  As the lead analyst for the hoosier burger project you have

as the lead analyst for the hoosier burger project you have worked closely with bob and thelma nbspmellankamp. having

  Make an employee class with enough numbers of data members

Make an Employee class with enough numbers of data members

  Describe the role of hardware components on a computer

Develop a 1,050-word summary describing the role of hardware components and operating system software on a computer.

  How you would solve conflict to get meeting back on track

Imagine you are leading a team of designers for a new software product. During the kickoff meeting, the team starts to discuss design guidelines.

  Describe virtual and augmented reality

Describe virtual and augmented reality. Suggest a way in which this technology could be used in the future; either to improve a current process.

  Describe in one sentence what this code does

Describe in one sentence what this code does. Assume that $a0 and $a1 are used for input and both initially contain the integers a and b, respectively.

  Explain how a neural net can be trained

Explain how a neural net can be trained. What are the three basic types of processing that occur during human/computer voice interaction?

  How much storage will probe require if it is to gather data

During each cycle of the system clock, the status of these five registers is written to nonvolatile memory attached to the probe circuitry. If each register is 64 bits wide, how much storage will the probe require if it is to gather data for 2 sec..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd