aboutsummaryrefslogtreecommitdiff
path: root/leetcode.h
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-01-29 11:25:10 -0700
committerJack Sangdahl <[email protected]>2025-01-29 11:25:10 -0700
commitad25ada54a68851b935f52f9d1bc4ec969583205 (patch)
tree51fbdf10eb4b19198bd77792b7c96c2494659276 /leetcode.h
parentc6b14242923a5f02b2d2f29457e11f4b7b393d77 (diff)
downloadleetcode-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.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/leetcode.h b/leetcode.h
index cc01748..c68a56a 100644
--- a/leetcode.h
+++ b/leetcode.h
@@ -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);