-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.h
119 lines (70 loc) · 3.22 KB
/
lib.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef LIB_H
#define LIB_H
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
#ifdef _WIN32
#define CLEAR_SCREEN "cls"
#else
#define CLEAR_SCREEN "clear"
#endif
struct node {
int value;
struct node* next;
};
struct node2 {
int a;
int b;
struct node2 *next;
};
typedef struct node node_t;
typedef struct node2 node_l;
typedef void (*FunctionPointer)(int, void*);
typedef void (*FunctionPoint)(int ,int,void*);
//-------------------------------------------------------------------------------------------------------------------------
void next (node_t *current_node , node_t *next_node);
void double_next(node_t *previous_node, node_t *current_node) ;
void value(node_t *current_node , int value);
int ass_val(node_t *head) ;
node_t *ass_next (node_t *head);
void allocation (node_t *head);
void clear_screen() ;
double measure_execution_time(FunctionPointer function_to_measure, int inputSize, void* param , int *iteration);
void get_primes(int num , int *iteration );
node_t* searching_for_primes2 (int num , int *iteration ) ;
void print_list2(node_t* head , int *iteration) ;
void free_linked_list(node_t* head ,int *iteration) ;
int* search_for_primes_arrays_ver2(int num, int *count , int *iteration) ;
void print_array2(int *arr, int size , int *iteration) ;
void arrays_functions(int num ,int *itera);
void lists_functions(int num , int *itera) ;
double measure_execution_time_ranged(FunctionPoint function_to_measure, int first, int end, int *iteration) ;
void delete_by_position(node_t** head, int position ,int *iteration) ;
node_t* generate_primes_in_range(int first, int end ,int *iteration) ;
void print_list_in_range(node_t* head, int first, int end ,int *iteration) ;
void range (int first , int end ,int *iteration) ;
void push_for_lists(node_t **head, int num , int *iteration) ;
void print_primes(node_t *head , int *iteration) ;
void prime_factorisation(int num, node_t **head , int *iteratoin) ;
void free_list(node_t *head , int *iteration) ;
void factorization (int num , int *iteration);
void value_a(node_l *node, int a);
void value_b(node_l *node, int b);
void next_l(node_l *node, node_l *next);
node_l* ass_next_l(node_l *node);
int GCD(int a, int b , int *iteration) ;
void printCoprimes(int num , int *iteration) ;
void co_push_for_lists(node_l **head, int a, int b , int *iteration) ;
void print_list_coprimes(node_l *head , int *iteration) ;
void co_free_list(node_l *head , int *iteration) ;
void coprime_list(int num , int *iteration) ;
void create_coprime_array(int ***arr, int *count, int num , int *iteration) ;
void print_array(int **arr, int count , int *iteration) ;
void free_array(int ***arr, int count , int *iteration) ;
void coprime_array(int num , int *iteration) ;
size_t size(void (*functiontype)(int, int*), int iteration) ;
size_t size_range (void (*functiontyperr)(int ,int,int*) ,int iteration);
void comparision (double time_taken1 , double time_taken2 , size_t size_taken1 , size_t size_taken2);
//-----------------------------------------------------------------------------------------------------------------------
#endif