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
*
p
1
,
*
p
2
;
p
1
=
cursor;
p
2
=
NULL;
while
(
p
1
&& p
1
-
>
location
<
a
.
location
)
{
p
2
=
p
1
;
p
1
=
p
1
-
>
next;
}
if
(
!
p
1
&&
!
p
2
)
{
cursor
=
p;
}
else if
(
(
!
p
1
&& p
2
)
|
|
(
p
1
&& p
2
)
)
{
p
-
>
next
=
p
1
;
p
2
-
>
next
=
p;
}
else if
(
!
p
2
&& p
1
)
{
p
-
>
next
=
p
1
;
cursor
=
p;
}
n
+
+
;
} convert this code to doubly circural list

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

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions

Question

Discuss the steps in the development planning process. page 399

Answered: 1 week ago

Question

Explain the pages in white the expert taxes

Answered: 1 week ago

Question

Identify the cause of a performance problem. page 363

Answered: 1 week ago