Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

void InsertInOrder ( martry a ) { node * p = new node; p - > location = a . location; p - > Name.push

void InsertInOrder(martry a)
{
node* p = new node;
p->location = a.location;
p->Name.push_back(a);
p->Date.push_back(a);
node* p1,* p2;
p1= cursor;
p2= NULL;
while (p1 && p1->location < a.location)
{
p2= p1;
p1= p1->next;
}
if (!p1 && !p2)
{
cursor = p;
}
else if ((!p1 && p2)||(p1 && p2))
{
p->next = p1;
p2->next = p;
}
else if (!p2 && p1)
{
p->next = p1;
cursor = p;
}
n++;
}

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

How are trading securities valued at the balance sheet date?

Answered: 1 week ago

Question

What are the organizations reputation goals on this issue?

Answered: 1 week ago

Question

What change do you need to make to achieve the desired position?

Answered: 1 week ago