mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-07 21:04:02 +08:00
* Review the EN heading format. * Fix pythontutor headings. * Fix pythontutor headings. * bug fixes * Fix headings in **/summary.md * Revisit the CN-to-EN translation for Python code using Claude-4.5 * Revisit the CN-to-EN translation for Java code using Claude-4.5 * Revisit the CN-to-EN translation for Cpp code using Claude-4.5. * Fix the dictionary. * Fix cpp code translation for the multipart strings. * Translate Go code to English. * Update workflows to test EN code. * Add EN translation for C. * Add EN translation for CSharp. * Add EN translation for Swift. * Trigger the CI check. * Revert. * Update en/hash_map.md * Add the EN version of Dart code. * Add the EN version of Kotlin code. * Add missing code files. * Add the EN version of JavaScript code. * Add the EN version of TypeScript code. * Fix the workflows. * Add the EN version of Ruby code. * Add the EN version of Rust code. * Update the CI check for the English version code. * Update Python CI check. * Fix cmakelists for en/C code. * Fix Ruby comments
36 lines
751 B
C
36 lines
751 B
C
/**
|
|
* File: include_test.c
|
|
* Created Time: 2023-01-10
|
|
* Author: Reanon (793584285@qq.com)
|
|
*/
|
|
|
|
#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);
|
|
|
|
// print tree
|
|
printTree(root);
|
|
|
|
// tree to arr
|
|
int *arr = treeToArray(root, &size);
|
|
printArray(arr, size);
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
printf("==testListNode==\n");
|
|
testListNode();
|
|
printf("==testTreeNode==\n");
|
|
testTreeNode();
|
|
return 0;
|
|
}
|