First Upload

This commit is contained in:
2022-02-25 15:33:16 +02:00
commit 0c74d10f0d
295 changed files with 74784 additions and 0 deletions

41
18 - Lists/ex4.c Normal file
View File

@@ -0,0 +1,41 @@
#include "Lib.h"
//-----------------------------------------------------------------
// LongestString
// -------------
//
// General : The function check who the longest string in list
//
// Parameters : **manager - pointer linear Linked List(IN)
//
// Return Value : The index of longest string
//
//-------------------------------------------------------------------
// Programer : Cohen Idan
// Student No. : 211675038
// Date : 12.12.2019
//-------------------------------------------------------------------
LLL * LongestString(LLL ** manager)
{
LLL * runner = *manager;
LLL * result = runner;
unsigned int max = ZERO;
unsigned int str_len = ZERO;
while (runner != NULL)
{
str_len = StringLenght((*runner).value.pointer);
if (str_len > max)
{
max = str_len;
result = runner;
}
runner = (*runner).next;
}
return (result);
}
void main(void)
{
}