Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!