Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Circular Singly Linked List Use this struct below. struct person { string name; person *knows; person(string x, person *t) { name= x; knows=

Create a Circular Singly Linked List

Use this struct below.

struct person { string name; person *knows; person(string x, person *t) { name= x; knows= t; } };

Follow how the image below on how to implement it

image text in transcribed

First, create a head pointer "Lead" as a leader of the group. Then, create three persons and make appropriate dereferencing (pointer connection) so that 1st person points 2nd; 2nd points 3rd; 3rd points 1st; Lead points 1st.

As the output of program, you need to show the name of leader, 1st, 2nd, and 3rd, such as

Leader is  1st is  2nd is  3rd is  

Please note that you do not create extra variables to keep person names and knows. You need to access next person using "knows" variable

Singly linked List head hamol adr first -> name adr second Iname adr third nametade

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions