mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-02 03:05:24 +08:00
* feat(ko): add the complete Korean online edition * Use UTF-8 for Python CI output on Windows * Remove print-book promotion from the Korean site * fix(ko): preserve emphasis before Korean particles
36 lines
784 B
C
36 lines
784 B
C
/**
|
|
* File: include_test.c
|
|
* Created Time: 2023-01-10
|
|
* Author: Reanon ([email protected])
|
|
*/
|
|
|
|
#include "common.h"
|
|
|
|
void testListNode() {
|
|
int nums[] = {2, 3, 5, 6, 7};
|
|
int size = sizeof(nums) / sizeof(int);
|
|
ListNode *head = arrToLinkedList(nums, size);
|
|
printLinkedList(head);
|
|
}
|
|
|
|
void testTreeNode() {
|
|
int nums[] = {1, 2, 3, INT_MAX, 5, 6, INT_MAX};
|
|
int size = sizeof(nums) / sizeof(int);
|
|
TreeNode *root = arrayToTree(nums, size);
|
|
|
|
// 트리를 출력한다
|
|
printTree(root);
|
|
|
|
// 트리를 배열로 변환한다
|
|
int *arr = treeToArray(root, &size);
|
|
printArray(arr, size);
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
printf("==testListNode==\n");
|
|
testListNode();
|
|
printf("==testTreeNode==\n");
|
|
testTreeNode();
|
|
return 0;
|
|
}
|