Question
**** need solution in C++ *** As shown in the figure below, there are four nodes in the system, and each node consists of four
**** need solution in C++ *** As shown in the figure below, there are four nodes in the system, and each node consists of four fields: one char field and three link fields. The char field contains exactly one char. Let us assign the letters L, I, V, and E to each one of the node. The three links of a node allows the node to directly connect to other three nodes in the system.
Write a program which builds up such a system. Use a pointer named head to point to the node with the letter L. Design the system so that it simulates the random walk of a robot. Initially the robot stands on the L node. It then randomly walks to any one of the other three nodes. It continues to do this for ten times and each time the system prints the letter which the robot stands on. The output might be something like the following:
L E L I V I L V E L
Step 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