Easy access to all functions of the repository.
32{
33 while(1)
34 {
35 char func[2];
36 printf("Which function du you want to test: ");
37 fgets(func, 3, stdin);
38
39 switch (func[0])
40 {
41 case 'a':
42 {
43
44
45 int num = 10;
46 printf("\nRunning recursive fibonacci function with value of %d...\n", num);
47 printf("RecursiveFib(%d) = ", num);
49 printf("\n");
50
51 break;
52 }
53 case 'b':
54 {
55
56 int num = 60;
57 printf("\nRunning dynamic fibonacci function with value of %d...\n", num);
58 printf("RecursiveFib(%d) = ", num);
60 printf("\n");
61 break;
62 }
63 case 'c':
64 {
65
66 char text[] = "THIS IS A TEXT TO SEARCH A PATTERN";
67 char pattern[] = "IS A";
68
69 printf("\nRunning pattern search...\n");
70
72 if (x == -1)
73 {
74 printf("No matched pattern found!\n");
75 }
76 printf("Pattern found at position %d\n", x);
77
78 printf("\n");
79 break;
80 }
81 case 'd':
82
84 exit(0);
85 break;
86 case 'e':
87
89 exit(0);
90 break;
91 case 'f':
92 {
93 printf("\nRunning double linked list...\n");
94
97
100
104
108
110
112
113 printf("\n");
114
115 break;
116 }
117
118 case 'X':
119 case 'x':
120
121 exit(0);
122
123 case '-':
124 switch (func[1])
125 {
126 case 'h':
127 printf("\nEnter the following characters to call the specific functions:\n");
128 printf("(a): Recursive Fibonacci\n");
129 printf("(b): Dynamic Fibonacci\n");
130 printf("(c): Patternsearch\n");
131 printf("(d): Stack\n");
132 printf("(e): Queue\n");
133 printf("(f): Double linked list\n");
134 printf("(X): Exit the programm\n\n");
135 break;
136
137 default:
138 printf("Invalid argument. Use -h for help.\n");
139 break;
140 }
141 break;
142 default:
143 printf("Invalid argument. Use -h for help.\n");
144 break;
145 }
146 fflush(stdin);
147 }
148}
Node * appendNodeToEndOfList(List *list, Node *node, bool check_for_existing_node)
Append a node to the end of a list.
Node * createNode(void)
Allocates memory for a new node and initalizes it.
void printList(List *list)
Print the whole List without trailing .
bool freeList(List *list)
Frees the memory of a list and all nodes in it.
List * createList(void)
Allocates memory for a new list and initalizes it.
void DynamicFib(int number)
Prints the return value of the called function RecFib.
uint32_t PatternSearch(char *text, char *pattern)
PatSearch is a Function to search for specific patterns in a text. (Be aware that its case sensitive!...
void RecursiveFib(int number)
Prints the return value of the called function RecFib.