(PR #204) update c code and doc for time_complexity

This commit is contained in:
sjinzh
2023-01-05 08:39:09 +08:00
23 changed files with 447 additions and 172 deletions

View File

@@ -0,0 +1,30 @@
/*
* File: PrintUtil.h
* Created Time: 2022-12-21
* Author: MolDum (moldum@163.com)
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// #include "ListNode.h"
// #include "TreeNode.h"
/**
* @brief Print an Array
*
* @param arr
* @param n
*/
static void printArray(int* arr, int n)
{
printf("[");
for (int i = 0; i < n - 1; i++) {
printf("%d, ", arr[i]);
}
printf("%d]\n", arr[n-1]);
}

View File

@@ -1,4 +1,15 @@
/*
* File: include.h
* Created Time: 2022-12-20
* Author: MolDuM (moldum@163.com)
*/
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <stdbool.h>
#include <time.h>
#include "PrintUtil.h"