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.21E
Program Plan Intro

Program plan:

  1. Item, start, result 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 *recsearch(node *head, int value) function searches the passing value in the linked list using recursion.
  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 using the value input by the user and it asks the user to enter the value to search in the linked list and it uses the recursive function to search the value and return the result.

Blurred answer
Students have asked these similar questions
Do the whole program in C++ & Please kindly share the whole program
Topic: Singly Linked ListImplement the following functions in C++ program. Read the question carefully. (See attached photo for reference)  int removeAt(int pos) Removes the number in the posth position of the list and returns the element removed. Performing removeAt(3) in the example list will remove the 3rd element of the linked list and the updated list will be: 10 -> 30 -> 50 When the value of pos is greater than the size or less than one, return -1. int removeAll(int num) Removes all instances of num in the linked list and returns the number of instances removed. In this list 10 -> 10 -> 20 -> 30 -> 10, performing removeAll(10) will remove all three 10's and the list will look like this: 20 -> 30. Then, it will return the number of instances removed, in this case, 3. int contains(int num) This will return the position of the first instance of the element num in the list. If num is not found, return 0. In the example, having the method contains(30) will…
- Question-2: Functions, Iterations and List • Write a function that takes a positive integer n as its parameter. • Return a list whose o values are numbers between n and 2n.
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