This commit is contained in:
ada-dmitry
2023-05-10 15:20:42 +03:00
parent 8fb559981e
commit c237cdd31a
7 changed files with 246 additions and 181 deletions
+28
View File
@@ -0,0 +1,28 @@
#include "prot.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int main(int argc, char *argv[])
{
node *head = NULL, *head2 = NULL, *head3 = NULL;
int r;
srand(time(NULL));
printf("Generated linked list (method of head)\n");
while ((r = (rand() % 100)) < 75)
head = add_head(head, r);
pr(head);
printf("Length of linked list is: %d\n", length(head));
printf("Sorted linked list\n");
sort(head);
pr(head);
hanoi_tower(length(head), &head, &head3, &head2, &head, &head2, &head3);
return 0;
}