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 with AI-Powered 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

Students also viewed these Databases questions

Question

Explain the pages in white the expert taxes

Answered: 1 week ago