Home > Back-end >  Group assignments, discussion area
Group assignments, discussion area

Time:04-26

Recursive programming
Topic: known f for single table header pointer that list is stored in the integer data, try to write a recursive algorithm to realize the following operations:
(1) the largest integer in the list;
(2) list of node number;
3. Please list all the nodes in the average of the data,
Note: 1. Apply to include the header node list; 2. Want to consider an empty list, containing only a linked list of nodes,

CodePudding user response:

https://blog.csdn.net/weixin_50816938/article/details/116105823

CodePudding user response:

About the Min value this definition can better?
#include
#include
Int Min;
using namespace std;
Typedef struct node * LinkList;
Struct node
{
int data;
LinkList next;
};
LinkList Intialization ();
Int return_max LinkList (L);
Int get_length LinkList (L);
Double get_average (LinkList L, int len);
Int main ()
{
LinkList L=Intialization ();
Min=L - & gt; The data;
  • Related