2025-03-25 18:09:23 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2025-03-28 10:42:19 +08:00
|
|
|
#include "linked_list.h"
|
2025-03-25 18:09:23 +08:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*sq_list* L = init_sq_list();
|
|
|
|
sq_list* N = init_sq_list();
|
|
|
|
for (int i = 1; i <= 3; i++)
|
|
|
|
{
|
|
|
|
N->data[i - 1] = i+10;
|
|
|
|
}
|
|
|
|
for (int i = 1; i <= 10; i++)
|
|
|
|
{
|
|
|
|
L->data[i - 1] = i;
|
|
|
|
}
|
|
|
|
N->length = 3;
|
|
|
|
L->length = 10;
|
|
|
|
print_sq_list(N);
|
|
|
|
print_sq_list(L);
|
|
|
|
mer_ge_sq_list(L,N);
|
|
|
|
print_sq_list(L);
|
|
|
|
printf("L->length:[%d]\n", L->length);*/
|
|
|
|
|
|
|
|
|
|
|
|
/* array_stack* stack = init_array_stack();
|
|
|
|
push_array_stack(stack, 1);
|
|
|
|
push_array_stack(stack, 2);
|
|
|
|
push_array_stack(stack, 3);*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-28 10:42:19 +08:00
|
|
|
/* array_queue *q = init_array_queue();
|
2025-03-25 18:09:23 +08:00
|
|
|
push_array_queue(q,0);
|
|
|
|
push_array_queue(q,1);
|
|
|
|
push_array_queue(q,2);
|
|
|
|
print_array_queue(q);
|
|
|
|
printf("---------------------\n");
|
|
|
|
pop_array_queue(q);
|
|
|
|
print_array_queue(q);
|
|
|
|
printf("----------\n");
|
|
|
|
push_array_queue(q, 666);
|
2025-03-28 10:42:19 +08:00
|
|
|
print_array_queue(q);*/
|
|
|
|
|
|
|
|
node* q1 = init_node(1);
|
|
|
|
node* q2 = init_node(2);
|
|
|
|
node* q3 = init_node(3);
|
|
|
|
node* q4 = init_node(4);
|
|
|
|
q1->next = q2;
|
|
|
|
q2->next = q3;
|
|
|
|
q3->next = q4;
|
|
|
|
//address_node *n = find_node(q1, 3);
|
|
|
|
// printf("%d\n %p\n", n->n,n->p
|
|
|
|
//int e = get_node_list(q1);
|
|
|
|
node* q2_3 = init_node(0);
|
|
|
|
insert_node(q2, q2_3);
|
|
|
|
print_node_list(q1);
|
|
|
|
delete_node(q2);
|
|
|
|
print_node_list(q1);
|
2025-03-25 18:09:23 +08:00
|
|
|
printf("Hello World!\n");
|
|
|
|
system("pause");
|
|
|
|
return 0;
|
|
|
|
}
|