Question: C++ Problem: I am trying to write a function that sends a messege through a network of cities (linked list). I have included pictures of
C++ Problem:
I am trying to write a function that sends a messege through a network of cities (linked list). I have included pictures of the code, city struct, defult network setup (order of cities on default networkodes of link list) and failed test cases. The city struct can not be modified and the code can not call any functions that aren't included in the
Default network path (Linked List of city names):
Los Angeles -> Phoenix -> Denver -> Dallas -> Atlanta -> New York -> NULL

Code:


Code Runner Failed Test Cases:



Purpose: populates the network with the predetermined cities @param head start of list @return head of list city* loadDefaultsetup(city *head) head = deleteEntireNetwork (head); head - addCity(head, NULL, "Los Angeles") city *tempCity tempCity = searchNetwork(head, head = addCity(head, tempCity, "Los Angeles"); "Phoenix"); tempCity searchNetwork(head, head = addCity(head, tempCity, "Phoenix"); "Denver"); tempCity= searchNetwork(head, head = addCity(head, tempCity, "Denver"); "Dallas"); tempCity= searchNetwork(head, head addCity(head, tempCity, "Dallas"); "Atlanta"); tempCity= searchNetwork(head, head = addCity (head, tempCity, "Atlanta"); "New York"); return head
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
