SlideShare a Scribd company logo
1 of 8
Download to read offline
Hi,
you covered mostly things.there are issue to point and link pointer.I will try my best to solve
your issue.
I have added below functions which are wrong or missing.
city* addCity(city *head, city *previous, string cityName )
{
if (head == NULL)
{
head = new city;
head->name = cityName;
return head;
}
city *newNode = new city;
newNode->name = cityName;
if (previous == NULL)
{
newNode->next = head;
head = newNode;
return head;
}
newNode->next = previous->next;
previous->next = newNode;
cout << "prev: " << previous->name << " new: " << cityName << endl;
return head;
}
newNode->name = cityName;
city *current = new city;
current = searchNetwork(head, previous->name);
newNode->next = current->next;
previous->next = newNode;
cout << "prev: " << previous->name << " new: " << cityName << endl;
city *searchNetwork(city *ptr, string cityName)
{
city *current = ptr;
while (current->name != cityName)
{
if (current->name != cityName && current->next == NULL)
return NULL;
current = current->next;
}
return current;
}
city* deleteCity(city *head, string cityName)
{
city *current = head;
cout << "Checkpoint 1" << endl;
while (current->next->name != cityName)
{
if (current->next == NULL)
{
cout << "City does not exist." << endl;
return head;
}
current = current->next;
}
cout << "Checkpoint 2" << endl;
current->next = current->next->next;
return head;
}
void printPath(city *ptr)
{
cout << "== CURRENT PATH ==" << endl;
// If the head is NULL
if (ptr == NULL)
cout << "nothing in path" << endl;
else
{
city *temp2 = ptr;
while( temp2!=NULL )
{
cout << temp2->name << " -> ";// show the data in the linked list
temp2 = temp2->next; // tranfer the address of 'temp->next' to 'temp'
}
cout << "NULL" << endl;
}
cout << "===" << endl;
}
city* loadDefaultSetup(city *head)
{
head = deleteEntireNetwork(head);
head = addCity(head,NULL,"Los Angeles");
city *two = new city;
city *three = new city;
city *four = new city;
city *five = new city;
city *six = new city;
two->name = "Phoenix";
three->name = "Denver";
four->name = "Dallas";
five->name = "Atlanta";
six->name = "New York";
head->next = two;
two->next = three;
three->next = four;
four->next = five;
five->next = six;
six->next = NULL;
return head;
}
Solution
Hi,
you covered mostly things.there are issue to point and link pointer.I will try my best to solve
your issue.
I have added below functions which are wrong or missing.
city* addCity(city *head, city *previous, string cityName )
{
if (head == NULL)
{
head = new city;
head->name = cityName;
return head;
}
city *newNode = new city;
newNode->name = cityName;
if (previous == NULL)
{
newNode->next = head;
head = newNode;
return head;
}
newNode->next = previous->next;
previous->next = newNode;
cout << "prev: " << previous->name << " new: " << cityName << endl;
return head;
}
newNode->name = cityName;
city *current = new city;
current = searchNetwork(head, previous->name);
newNode->next = current->next;
previous->next = newNode;
cout << "prev: " << previous->name << " new: " << cityName << endl;
city *searchNetwork(city *ptr, string cityName)
{
city *current = ptr;
while (current->name != cityName)
{
if (current->name != cityName && current->next == NULL)
return NULL;
current = current->next;
}
return current;
}
city* deleteCity(city *head, string cityName)
{
city *current = head;
cout << "Checkpoint 1" << endl;
while (current->next->name != cityName)
{
if (current->next == NULL)
{
cout << "City does not exist." << endl;
return head;
}
current = current->next;
}
cout << "Checkpoint 2" << endl;
current->next = current->next->next;
return head;
}
void printPath(city *ptr)
{
cout << "== CURRENT PATH ==" << endl;
// If the head is NULL
if (ptr == NULL)
cout << "nothing in path" << endl;
else
{
city *temp2 = ptr;
while( temp2!=NULL )
{
cout << temp2->name << " -> ";// show the data in the linked list
temp2 = temp2->next; // tranfer the address of 'temp->next' to 'temp'
}
cout << "NULL" << endl;
}
cout << "===" << endl;
}
city* loadDefaultSetup(city *head)
{
head = deleteEntireNetwork(head);
head = addCity(head,NULL,"Los Angeles");
city *two = new city;
city *three = new city;
city *four = new city;
city *five = new city;
city *six = new city;
two->name = "Phoenix";
three->name = "Denver";
four->name = "Dallas";
five->name = "Atlanta";
six->name = "New York";
head->next = two;
two->next = three;
three->next = four;
four->next = five;
five->next = six;
six->next = NULL;
return head;
}

More Related Content

Similar to Hi,you covered mostly things.there are issue to point and link poi.pdf

Need help getting past an error in C++! I have all my code pasted down.docx
Need help getting past an error in C++! I have all my code pasted down.docxNeed help getting past an error in C++! I have all my code pasted down.docx
Need help getting past an error in C++! I have all my code pasted down.docxJason0x0Scottw
 
#include iostream #include fstream #include iomanip #.pdf
 #include iostream #include fstream #include iomanip #.pdf #include iostream #include fstream #include iomanip #.pdf
#include iostream #include fstream #include iomanip #.pdfKARTIKINDIA
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdffeelinggift
 
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docxreverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docxacarolyn
 
#include iostream#include d_node.h #include d_nodel.h.docx
#include iostream#include d_node.h #include d_nodel.h.docx#include iostream#include d_node.h #include d_nodel.h.docx
#include iostream#include d_node.h #include d_nodel.h.docxajoy21
 
In C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdfIn C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdffantoosh1
 
Help I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdfHelp I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdfmail931892
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cMoseStaton39
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cSilvaGraf83
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cSilvaGraf83
 
Solution#includestdio.h#includeconio.h#includealloc.h.pdf
Solution#includestdio.h#includeconio.h#includealloc.h.pdfSolution#includestdio.h#includeconio.h#includealloc.h.pdf
Solution#includestdio.h#includeconio.h#includealloc.h.pdfpoddaranand1
 
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docxGIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docxLeonardN9WWelchw
 
This is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdfThis is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdfkostikjaylonshaewe47
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdffortmdu
 
could you implement this function please, im having issues with it..pdf
could you implement this function please, im having issues with it..pdfcould you implement this function please, im having issues with it..pdf
could you implement this function please, im having issues with it..pdfferoz544
 
#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docxajoy21
 
#include iostream #includestdlib.h using namespace std;str.pdf
#include iostream #includestdlib.h using namespace std;str.pdf#include iostream #includestdlib.h using namespace std;str.pdf
#include iostream #includestdlib.h using namespace std;str.pdflakshmijewellery
 
THE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdf
THE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdfTHE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdf
THE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdffathimahardwareelect
 
How to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdfHow to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdffootstatus
 

Similar to Hi,you covered mostly things.there are issue to point and link poi.pdf (20)

Need help getting past an error in C++! I have all my code pasted down.docx
Need help getting past an error in C++! I have all my code pasted down.docxNeed help getting past an error in C++! I have all my code pasted down.docx
Need help getting past an error in C++! I have all my code pasted down.docx
 
#include iostream #include fstream #include iomanip #.pdf
 #include iostream #include fstream #include iomanip #.pdf #include iostream #include fstream #include iomanip #.pdf
#include iostream #include fstream #include iomanip #.pdf
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdf
 
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docxreverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docx
 
#include iostream#include d_node.h #include d_nodel.h.docx
#include iostream#include d_node.h #include d_nodel.h.docx#include iostream#include d_node.h #include d_nodel.h.docx
#include iostream#include d_node.h #include d_nodel.h.docx
 
In C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdfIn C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdf
 
Help I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdfHelp I keep getting the same error when running a code. Below is the.pdf
Help I keep getting the same error when running a code. Below is the.pdf
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
Lab-2.4 101.pdf
Lab-2.4 101.pdfLab-2.4 101.pdf
Lab-2.4 101.pdf
 
Solution#includestdio.h#includeconio.h#includealloc.h.pdf
Solution#includestdio.h#includeconio.h#includealloc.h.pdfSolution#includestdio.h#includeconio.h#includealloc.h.pdf
Solution#includestdio.h#includeconio.h#includealloc.h.pdf
 
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docxGIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
 
This is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdfThis is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdf
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
 
could you implement this function please, im having issues with it..pdf
could you implement this function please, im having issues with it..pdfcould you implement this function please, im having issues with it..pdf
could you implement this function please, im having issues with it..pdf
 
#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx
 
#include iostream #includestdlib.h using namespace std;str.pdf
#include iostream #includestdlib.h using namespace std;str.pdf#include iostream #includestdlib.h using namespace std;str.pdf
#include iostream #includestdlib.h using namespace std;str.pdf
 
THE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdf
THE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdfTHE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdf
THE CODE HAS A SEGMENTATION FAULT BUT I CANNOT FIND OUT WHERE. NEED .pdf
 
How to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdfHow to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdf
 

More from aryan9007

A sustainable transportation system is one that • allows the basic .pdf
A sustainable transportation system is one that • allows the basic .pdfA sustainable transportation system is one that • allows the basic .pdf
A sustainable transportation system is one that • allows the basic .pdfaryan9007
 
37511250Solution37511250.pdf
37511250Solution37511250.pdf37511250Solution37511250.pdf
37511250Solution37511250.pdfaryan9007
 
2)The 2 strongest dimensions of my personality area)direction It.pdf
2)The 2 strongest dimensions of my personality area)direction  It.pdf2)The 2 strongest dimensions of my personality area)direction  It.pdf
2)The 2 strongest dimensions of my personality area)direction It.pdfaryan9007
 
1+5 = 6Solution1+5 = 6.pdf
1+5 = 6Solution1+5 = 6.pdf1+5 = 6Solution1+5 = 6.pdf
1+5 = 6Solution1+5 = 6.pdfaryan9007
 
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdfaryan9007
 
pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdf
                     pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdf                     pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdf
pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdfaryan9007
 
moles of NaOH = 0.250 1.2 10^-3 = 3 10^-4 M.pdf
                     moles of NaOH = 0.250  1.2  10^-3 = 3  10^-4 M.pdf                     moles of NaOH = 0.250  1.2  10^-3 = 3  10^-4 M.pdf
moles of NaOH = 0.250 1.2 10^-3 = 3 10^-4 M.pdfaryan9007
 
molarity = no of moles volume no of moles = mas.pdf
                     molarity = no of moles  volume no of moles = mas.pdf                     molarity = no of moles  volume no of moles = mas.pdf
molarity = no of moles volume no of moles = mas.pdfaryan9007
 
Pharmacology Stimulates alpha and beta receptors.pdf
                     Pharmacology  Stimulates alpha and beta receptors.pdf                     Pharmacology  Stimulates alpha and beta receptors.pdf
Pharmacology Stimulates alpha and beta receptors.pdfaryan9007
 
step1 moles of FeS = 25000x1000Molar mass of FeS.pdf
                     step1 moles of FeS = 25000x1000Molar mass of FeS.pdf                     step1 moles of FeS = 25000x1000Molar mass of FeS.pdf
step1 moles of FeS = 25000x1000Molar mass of FeS.pdfaryan9007
 
React with water Li, Ca, Ba, Na .pdf
                     React with water Li, Ca, Ba, Na                 .pdf                     React with water Li, Ca, Ba, Na                 .pdf
React with water Li, Ca, Ba, Na .pdfaryan9007
 
The Schiff test invented [1] and named after Hugo.pdf
                     The Schiff test invented [1] and named after Hugo.pdf                     The Schiff test invented [1] and named after Hugo.pdf
The Schiff test invented [1] and named after Hugo.pdfaryan9007
 
I- Solu.pdf
                     I-                                       Solu.pdf                     I-                                       Solu.pdf
I- Solu.pdfaryan9007
 
CDE are already in cyclic form A is long enough t.pdf
                     CDE are already in cyclic form A is long enough t.pdf                     CDE are already in cyclic form A is long enough t.pdf
CDE are already in cyclic form A is long enough t.pdfaryan9007
 
C) HF is the strongest acid among them. H2O and .pdf
                     C) HF is the strongest acid among them.  H2O and .pdf                     C) HF is the strongest acid among them.  H2O and .pdf
C) HF is the strongest acid among them. H2O and .pdfaryan9007
 
broken images, cant view, cant help Re post i.pdf
                     broken images, cant view, cant help Re post i.pdf                     broken images, cant view, cant help Re post i.pdf
broken images, cant view, cant help Re post i.pdfaryan9007
 
Yes. Provided that the test is actually performed fairly (true doubl.pdf
Yes. Provided that the test is actually performed fairly (true doubl.pdfYes. Provided that the test is actually performed fairly (true doubl.pdf
Yes. Provided that the test is actually performed fairly (true doubl.pdfaryan9007
 
The studies below provide evidence linking genes and behavior1. F.pdf
The studies below provide evidence linking genes and behavior1. F.pdfThe studies below provide evidence linking genes and behavior1. F.pdf
The studies below provide evidence linking genes and behavior1. F.pdfaryan9007
 
the matrix does not have Enough Rational Eigenvalues to diagonalise.pdf
the matrix does not have Enough Rational Eigenvalues to diagonalise.pdfthe matrix does not have Enough Rational Eigenvalues to diagonalise.pdf
the matrix does not have Enough Rational Eigenvalues to diagonalise.pdfaryan9007
 
The differences in activities between system development and system .pdf
The differences in activities between system development and system .pdfThe differences in activities between system development and system .pdf
The differences in activities between system development and system .pdfaryan9007
 

More from aryan9007 (20)

A sustainable transportation system is one that • allows the basic .pdf
A sustainable transportation system is one that • allows the basic .pdfA sustainable transportation system is one that • allows the basic .pdf
A sustainable transportation system is one that • allows the basic .pdf
 
37511250Solution37511250.pdf
37511250Solution37511250.pdf37511250Solution37511250.pdf
37511250Solution37511250.pdf
 
2)The 2 strongest dimensions of my personality area)direction It.pdf
2)The 2 strongest dimensions of my personality area)direction  It.pdf2)The 2 strongest dimensions of my personality area)direction  It.pdf
2)The 2 strongest dimensions of my personality area)direction It.pdf
 
1+5 = 6Solution1+5 = 6.pdf
1+5 = 6Solution1+5 = 6.pdf1+5 = 6Solution1+5 = 6.pdf
1+5 = 6Solution1+5 = 6.pdf
 
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 
pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdf
                     pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdf                     pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdf
pOH = 14 - 11.5 = 2.5 [OH-]= 10^-2.5 = 0.003162 M.pdf
 
moles of NaOH = 0.250 1.2 10^-3 = 3 10^-4 M.pdf
                     moles of NaOH = 0.250  1.2  10^-3 = 3  10^-4 M.pdf                     moles of NaOH = 0.250  1.2  10^-3 = 3  10^-4 M.pdf
moles of NaOH = 0.250 1.2 10^-3 = 3 10^-4 M.pdf
 
molarity = no of moles volume no of moles = mas.pdf
                     molarity = no of moles  volume no of moles = mas.pdf                     molarity = no of moles  volume no of moles = mas.pdf
molarity = no of moles volume no of moles = mas.pdf
 
Pharmacology Stimulates alpha and beta receptors.pdf
                     Pharmacology  Stimulates alpha and beta receptors.pdf                     Pharmacology  Stimulates alpha and beta receptors.pdf
Pharmacology Stimulates alpha and beta receptors.pdf
 
step1 moles of FeS = 25000x1000Molar mass of FeS.pdf
                     step1 moles of FeS = 25000x1000Molar mass of FeS.pdf                     step1 moles of FeS = 25000x1000Molar mass of FeS.pdf
step1 moles of FeS = 25000x1000Molar mass of FeS.pdf
 
React with water Li, Ca, Ba, Na .pdf
                     React with water Li, Ca, Ba, Na                 .pdf                     React with water Li, Ca, Ba, Na                 .pdf
React with water Li, Ca, Ba, Na .pdf
 
The Schiff test invented [1] and named after Hugo.pdf
                     The Schiff test invented [1] and named after Hugo.pdf                     The Schiff test invented [1] and named after Hugo.pdf
The Schiff test invented [1] and named after Hugo.pdf
 
I- Solu.pdf
                     I-                                       Solu.pdf                     I-                                       Solu.pdf
I- Solu.pdf
 
CDE are already in cyclic form A is long enough t.pdf
                     CDE are already in cyclic form A is long enough t.pdf                     CDE are already in cyclic form A is long enough t.pdf
CDE are already in cyclic form A is long enough t.pdf
 
C) HF is the strongest acid among them. H2O and .pdf
                     C) HF is the strongest acid among them.  H2O and .pdf                     C) HF is the strongest acid among them.  H2O and .pdf
C) HF is the strongest acid among them. H2O and .pdf
 
broken images, cant view, cant help Re post i.pdf
                     broken images, cant view, cant help Re post i.pdf                     broken images, cant view, cant help Re post i.pdf
broken images, cant view, cant help Re post i.pdf
 
Yes. Provided that the test is actually performed fairly (true doubl.pdf
Yes. Provided that the test is actually performed fairly (true doubl.pdfYes. Provided that the test is actually performed fairly (true doubl.pdf
Yes. Provided that the test is actually performed fairly (true doubl.pdf
 
The studies below provide evidence linking genes and behavior1. F.pdf
The studies below provide evidence linking genes and behavior1. F.pdfThe studies below provide evidence linking genes and behavior1. F.pdf
The studies below provide evidence linking genes and behavior1. F.pdf
 
the matrix does not have Enough Rational Eigenvalues to diagonalise.pdf
the matrix does not have Enough Rational Eigenvalues to diagonalise.pdfthe matrix does not have Enough Rational Eigenvalues to diagonalise.pdf
the matrix does not have Enough Rational Eigenvalues to diagonalise.pdf
 
The differences in activities between system development and system .pdf
The differences in activities between system development and system .pdfThe differences in activities between system development and system .pdf
The differences in activities between system development and system .pdf
 

Recently uploaded

OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 

Recently uploaded (20)

OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 

Hi,you covered mostly things.there are issue to point and link poi.pdf

  • 1. Hi, you covered mostly things.there are issue to point and link pointer.I will try my best to solve your issue. I have added below functions which are wrong or missing. city* addCity(city *head, city *previous, string cityName ) { if (head == NULL) { head = new city; head->name = cityName; return head; } city *newNode = new city; newNode->name = cityName; if (previous == NULL) { newNode->next = head; head = newNode; return head; } newNode->next = previous->next; previous->next = newNode; cout << "prev: " << previous->name << " new: " << cityName << endl; return head; } newNode->name = cityName; city *current = new city; current = searchNetwork(head, previous->name);
  • 2. newNode->next = current->next; previous->next = newNode; cout << "prev: " << previous->name << " new: " << cityName << endl; city *searchNetwork(city *ptr, string cityName) { city *current = ptr; while (current->name != cityName) { if (current->name != cityName && current->next == NULL) return NULL; current = current->next; } return current; } city* deleteCity(city *head, string cityName) { city *current = head; cout << "Checkpoint 1" << endl; while (current->next->name != cityName) { if (current->next == NULL) { cout << "City does not exist." << endl; return head; } current = current->next; }
  • 3. cout << "Checkpoint 2" << endl; current->next = current->next->next; return head; } void printPath(city *ptr) { cout << "== CURRENT PATH ==" << endl; // If the head is NULL if (ptr == NULL) cout << "nothing in path" << endl; else { city *temp2 = ptr; while( temp2!=NULL ) { cout << temp2->name << " -> ";// show the data in the linked list temp2 = temp2->next; // tranfer the address of 'temp->next' to 'temp' } cout << "NULL" << endl; } cout << "===" << endl; } city* loadDefaultSetup(city *head) { head = deleteEntireNetwork(head); head = addCity(head,NULL,"Los Angeles"); city *two = new city; city *three = new city; city *four = new city; city *five = new city;
  • 4. city *six = new city; two->name = "Phoenix"; three->name = "Denver"; four->name = "Dallas"; five->name = "Atlanta"; six->name = "New York"; head->next = two; two->next = three; three->next = four; four->next = five; five->next = six; six->next = NULL; return head; } Solution Hi, you covered mostly things.there are issue to point and link pointer.I will try my best to solve your issue. I have added below functions which are wrong or missing. city* addCity(city *head, city *previous, string cityName ) { if (head == NULL) { head = new city; head->name = cityName; return head; }
  • 5. city *newNode = new city; newNode->name = cityName; if (previous == NULL) { newNode->next = head; head = newNode; return head; } newNode->next = previous->next; previous->next = newNode; cout << "prev: " << previous->name << " new: " << cityName << endl; return head; } newNode->name = cityName; city *current = new city; current = searchNetwork(head, previous->name); newNode->next = current->next; previous->next = newNode; cout << "prev: " << previous->name << " new: " << cityName << endl; city *searchNetwork(city *ptr, string cityName) { city *current = ptr; while (current->name != cityName) { if (current->name != cityName && current->next == NULL) return NULL; current = current->next; }
  • 6. return current; } city* deleteCity(city *head, string cityName) { city *current = head; cout << "Checkpoint 1" << endl; while (current->next->name != cityName) { if (current->next == NULL) { cout << "City does not exist." << endl; return head; } current = current->next; } cout << "Checkpoint 2" << endl; current->next = current->next->next; return head; } void printPath(city *ptr) { cout << "== CURRENT PATH ==" << endl; // If the head is NULL if (ptr == NULL) cout << "nothing in path" << endl; else { city *temp2 = ptr;
  • 7. while( temp2!=NULL ) { cout << temp2->name << " -> ";// show the data in the linked list temp2 = temp2->next; // tranfer the address of 'temp->next' to 'temp' } cout << "NULL" << endl; } cout << "===" << endl; } city* loadDefaultSetup(city *head) { head = deleteEntireNetwork(head); head = addCity(head,NULL,"Los Angeles"); city *two = new city; city *three = new city; city *four = new city; city *five = new city; city *six = new city; two->name = "Phoenix"; three->name = "Denver"; four->name = "Dallas"; five->name = "Atlanta"; six->name = "New York"; head->next = two; two->next = three; three->next = four; four->next = five; five->next = six; six->next = NULL;