diff options
author | Jack Sangdahl <[email protected]> | 2025-01-29 11:25:10 -0700 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-01-29 11:25:10 -0700 |
commit | ad25ada54a68851b935f52f9d1bc4ec969583205 (patch) | |
tree | 51fbdf10eb4b19198bd77792b7c96c2494659276 /leetcode.h | |
parent | c6b14242923a5f02b2d2f29457e11f4b7b393d77 (diff) | |
download | leetcode-ad25ada54a68851b935f52f9d1bc4ec969583205.tar.gz leetcode-ad25ada54a68851b935f52f9d1bc4ec969583205.zip |
chore: Add function to build entire TreeNode
* Use typedef over define
* Tidy includes
Diffstat (limited to 'leetcode.h')
-rw-r--r-- | leetcode.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,3 +1,4 @@ +#pragma once #include "lib/uthash/src/uthash.h" #include <assert.h> #include <ctype.h> @@ -9,13 +10,11 @@ #include <stdlib.h> #include <string.h> -#pragma once - #ifdef __cplusplus #include <bits/stdc++.h> using namespace std; -#define vvd(data) vector<vector<data>> +typedef vector<vector<int>> vvd; struct ListNode { int val; @@ -80,6 +79,7 @@ void listnode_print(struct ListNode *head); void listnode_free(struct ListNode *head); struct TreeNode *treenode_create(int val); +struct TreeNode *treenode_build(int *vals, int size); void treenode_print(struct TreeNode *root); void treenode_free(struct TreeNode *root); |