Question
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
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 is1st 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 nametadeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started