commit
4d35f7367f
11
.gitignore
vendored
11
.gitignore
vendored
@ -51,6 +51,13 @@ Module.symvers
|
|||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
/.vs/Project2
|
/.vs/Project2
|
||||||
/.vs
|
.vscode/
|
||||||
.vscode/settings.json
|
*.tlog
|
||||||
|
*.tlog
|
||||||
*.recipe
|
*.recipe
|
||||||
|
*.tlog
|
||||||
|
/Project2
|
||||||
|
*.tlog
|
||||||
|
*.tlog
|
||||||
|
Project2/Debug/Project2.tlog/link.read.1.tlog
|
||||||
|
Project2/Debug/Project2.tlog/link.secondary.1.tlog
|
@ -41,4 +41,12 @@ int pop_stack_linked(stack_linked* s)
|
|||||||
free(tmp);
|
free(tmp);
|
||||||
tmp = NULL;
|
tmp = NULL;
|
||||||
return flog;
|
return flog;
|
||||||
|
}
|
||||||
|
void print_linked(stack_linked* s) {
|
||||||
|
stack_node* L = s->top;
|
||||||
|
while (L != NULL) {
|
||||||
|
printf("%d", L->value);
|
||||||
|
L = L->next;
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
}
|
}
|
@ -23,6 +23,8 @@ void push_stack_linked(stack_linked* s, elem_type value);
|
|||||||
|
|
||||||
// 出栈
|
// 出栈
|
||||||
int pop_stack_linked(stack_linked* s);
|
int pop_stack_linked(stack_linked* s);
|
||||||
|
//输出
|
||||||
|
void print_linked(stack_linked* s);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
31
main.c
31
main.c
@ -1,13 +1,27 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "array_queue.h"
|
|
||||||
|
|
||||||
int main(void)
|
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);
|
||||||
/*sq_list* L = init_sq_list();
|
/*sq_list* L = init_sq_list();
|
||||||
sq_list* N = init_sq_list();
|
sq_list* N = init_sq_list();
|
||||||
for (int i = 1; i <= 3; i++)
|
for (int i = 1; i <= 3; i++)
|
||||||
@ -62,7 +76,15 @@ int main(void)
|
|||||||
// delete_node(q2);
|
// delete_node(q2);
|
||||||
// print_node_list(q1);
|
// print_node_list(q1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
stack_linked* head = init_stack_linked();
|
||||||
|
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);
|
||||||
|
*/
|
||||||
|
|
||||||
// queue_test();
|
// queue_test();
|
||||||
array_queue *q = init_array_queue();
|
array_queue *q = init_array_queue();
|
||||||
@ -76,7 +98,6 @@ int main(void)
|
|||||||
printf("----------\n");
|
printf("----------\n");
|
||||||
push_array_queue(q, 666);
|
push_array_queue(q, 666);
|
||||||
print_array_queue(q);
|
print_array_queue(q);
|
||||||
|
|
||||||
printf("Hello World!\n");
|
printf("Hello World!\n");
|
||||||
system("pause");
|
system("pause");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user