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 nametade
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
