Question: Using C++ write a code to solve the following problem using singly linked List. Start with an empty list. You will toss a coin. If
Using C++ write a code to solve the following problem using singly linked List. Start with an empty list. You will toss a coin. If you get a head you add two nodes at the end of the list, otherwise you will delete the very first node in the list. If you reach more than 20 nodes or 0 nodes you stop. Report on the number of times you get a list consisting of 20 nodes or a list of 0 nodes (empty list).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
