Horje
recherche recursive le max dans une liste Code Example
recherche recursive le max dans une liste
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
int maxrecursive(liste L)
 
{
 
    if(L==NULL)
 
        exit(EXIT_FAILURE);
 
    liste temp=L;
 
    int max=temp->element;
 
    if(longueur(L)==1)
 
        return temp->element;
 
    if(temp->suivant==NULL)
 
        return max;
 
    else
 
        if(temp->element<temp->suivant->element)
 
        {
 
            temp=temp->suivant;
 
            return temp->element;
 
        }
 
        else
 
            return maxrecursive(temp->suivant);
 
}




Cpp

Related
Array implementation of Queue using class in c++ Code Example Array implementation of Queue using class in c++ Code Example
How to remove to an Array Code Example How to remove to an Array Code Example
qrandomgenerator bounded Code Example qrandomgenerator bounded Code Example
how to print an array in cpp in single line Code Example how to print an array in cpp in single line Code Example
assign value to a pointer Code Example assign value to a pointer Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7