2025-03-17 14:00:57 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
|
2025-03-21 18:54:51 +08:00
|
|
|
//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);
|
2025-03-24 21:08:31 +08:00
|
|
|
/*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);*/
|
2025-03-21 18:54:51 +08:00
|
|
|
|
2025-03-24 21:08:31 +08:00
|
|
|
|
|
|
|
/* array_stack* stack = init_array_stack();
|
2025-03-21 18:54:51 +08:00
|
|
|
push_array_stack(stack, 1);
|
|
|
|
push_array_stack(stack, 2);
|
2025-03-24 21:08:31 +08:00
|
|
|
push_array_stack(stack, 3);*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-27 11:38:12 +08:00
|
|
|
/* array_queue *q = init_array_queue();
|
2025-03-24 09:37:44 +08:00
|
|
|
push_array_queue(q,0);
|
|
|
|
push_array_queue(q,1);
|
|
|
|
push_array_queue(q,2);
|
|
|
|
print_array_queue(q);
|
|
|
|
printf("---------------------\n");
|
2025-03-24 21:27:48 +08:00
|
|
|
pop_array_queue(q);
|
2025-03-24 09:37:44 +08:00
|
|
|
print_array_queue(q);
|
|
|
|
printf("----------\n");
|
|
|
|
push_array_queue(q, 666);
|
2025-03-27 11:38:12 +08:00
|
|
|
print_array_queue(q);*/
|
|
|
|
|
2025-04-17 09:38:24 +08:00
|
|
|
// 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-04-17 09:48:22 +08:00
|
|
|
|
2025-04-17 18:01:52 +08:00
|
|
|
/*
|
|
|
|
stack_linked* head = init_stack_linked();
|
2025-04-17 17:46:05 +08:00
|
|
|
push_stack_linked(head, 1);
|
|
|
|
push_stack_linked(head, 2);
|
|
|
|
push_stack_linked(head, 3);
|
|
|
|
print_linked(head);
|
|
|
|
pop_stack_linked(head);
|
|
|
|
print_linked(head);
|
2025-04-17 18:01:52 +08:00
|
|
|
*/
|
2025-04-17 09:38:24 +08:00
|
|
|
|
2025-04-17 09:48:22 +08:00
|
|
|
// queue_test();
|
2025-04-17 09:38:24 +08:00
|
|
|
array_queue *q = init_array_queue();
|
|
|
|
push_array_queue(q, 1);
|
|
|
|
push_array_queue(q, 2);
|
|
|
|
push_array_queue(q, 3);
|
|
|
|
print_array_queue(q);
|
|
|
|
printf("----------\n");
|
|
|
|
pop_array_queue(q);
|
|
|
|
print_array_queue(q);
|
|
|
|
printf("----------\n");
|
|
|
|
push_array_queue(q, 666);
|
|
|
|
print_array_queue(q);
|
2025-03-17 14:00:57 +08:00
|
|
|
printf("Hello World!\n");
|
2025-03-20 23:34:22 +08:00
|
|
|
system("pause");
|
2025-03-17 14:00:57 +08:00
|
|
|
return 0;
|
2025-03-17 14:33:15 +08:00
|
|
|
}
|