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

51
18 - Lists/ex1.c Normal file
View File

@@ -0,0 +1,51 @@
#include "Lib.h"
#define ASTERISK '*'
//-----------------------------------------------------------
// MostInRow
// ---------
//
// General : The function check who the longest word in
// list
//
// Parameters : **manager - pointer linear Linked List(IN)
//
// Return Value : The function returns the pointer of the
// beginning of the big word.
//
//------------------------------------------------------------
// Programer : Cohen Idan
// Student No. : 211675038
// Date : 12.12.2019
//------------------------------------------------------------
LLL * MostInRow(LLL ** manager)
{
LLL * pos = *manager;
LLL * max_word = pos;
LLL * temp_word = pos;
unsigned int max_count = ZERO;
unsigned int temp_count = ZERO;
while ((*pos).next != NULL)
{
if ((*pos).value.char_ == ASTERISK)
{
if (temp_count > max_count)
{
max_word = temp_word;
max_count = temp_count;
}
temp_count = ZERO;
temp_word = (*pos).next;
}
temp_count++;
pos = (*pos).next;
}
return (max_word);
}
void main(void)
{
}