Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Name:M . Avinash Reddy Date: ONLY WRITE OUTPUT ON THE TEST. MUST SHOW WORK FOR CREDIT ( ON SEPARATE PAPERS LABELLED ) I. GIVEN

1
Name:M.Avinash Reddy
Date:
ONLY WRITE OUTPUT ON THE TEST. MUST SHOW WORK FOR CREDIT (ON SEPARATE PAPERS LABELLED)
I. GIVEN THE FOLLOWING LINKED LIST CODE INDICATE THE OUTPUT.
NEW(NEWNODE);
NEWNODE.INFO =52;
NEWNODE.NEXT = NIL;
P= NEWNODE;
NEW(T);
T.INFO =10;
T.NEXT = NIL;
FIRST = T;
NEW(P);
P.INFO =11;
P.NEXT = T;
NEW(Q);
Q.INFO =3;
Q.NEXT = NEWNODE;
NEW (R);
R.NEXT = FIRST;
R.INFO =25;
P.NEXT = R;
FIRST.NEXT =P;
NEW(S);
R.NEXT = NIL;
S.INFO =4;
S.NEXT = FIRST;
P= FIRST;
WHILE P!= NIL DO
WRITE(
P.INFO);
P=P.NEXT;
END WHILE
FIRST =Q;
T.NEXT = NIL;
FIRST =T;
P=R;
P.NEXT =T;
R.NEXT = FIRST;
P=R;
WHILE P!= NIL DO
WRITE(
P.INFO);
P=P.NExT;
END WHILE;
II. WRITE A FUNCTION TO DETERMINE THE SIZE (NUMBER OF NODES) OF TWO SEPARATE LINKED LISTS AND DETERMINE WHICH LINKED LIST IS LONGER. WRITE THE FUNCTION IN EITHER PSEUDOCODE OR C++ REMEMBER TO COVER ALL CASES.
image text in transcribed

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago