C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 12, Problem 12.20E
Program Plan Intro

Program plan:

  1. Item, start variablesare used for input. There is structure listnode havingdata, nextPtrmember variables which represents the linked listnode.
  2. void insert(node **head, int value) function inserts the node in the a linked list.
  3. node *printListBackward(node *head) function reverse the linked list and return the head which points to reverse linked list.
  4. void printList(node *head) function display the contents of the linked list.

Program description:

The main purpose of the program is to create a linked list by the value input by the user and then reverse that linked list recursively.

Blurred answer
Students have asked these similar questions
(This is a c++ program question solve it according to the question and give me the code here with output please) 1. For unsortedList: Write a function to Print "Same Value" If there are same data more than one otherwise print "No repeated data".
(Data Structures and Algo C++ Weiss 4th ed -  ch7.40): The following divide-and-conquer algorithm is proposed for finding the simultaneous maximum and minimum: If there is one item, it is the maximum and minimum, and if there are two items, then compare them, and in one comparison you can find the maximum and minimum. Otherwise, split the input into two halves, divided as evenly as possibly (if N is odd, one of the two halves will have one more element than the other). Recursively find the maximum and minimum of each half, and then in two additional comparisons produce the maximum and minimum for the entire problem. In C++, find a function which will take in a vector and solve the problem, producing a vector of two elements, the min and max.
Under your module imports, paste the following definitions:   (define WIDTH 300) (define HEIGHT 160) (define ES (empty-scene WIDTH HEIGHT)) (define (next-size s) (/ s 2))   Next, write a tail-call recursive function called circles.  This function should take two numbers, x and size, and a Scene scn.  If size is less-than or equal to 2, then your function returns the scn unchanged (base case). Otherwise, your function should place a circle in the Scene that results from a recursive call to circles with x shifted by (+ size (next-size size)), a new size of (next-size size), and using the original Scene.  After evaluating (circles 100 48 ES), your function should output this image of five blue circles, in this order, with the first circle at (x,y) coordinate position (100, 80):
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning