aboutsummaryrefslogtreecommitdiff
path: root/leetcode.h
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2024-10-19 13:08:08 -0600
committerJack Sangdahl <[email protected]>2024-10-19 13:08:08 -0600
commit725a6a2c9ab947c32543bccc15aca2ca966c857b (patch)
tree9b082336500d640f08962891ffb12b86e0d5aa82 /leetcode.h
parent2d28c29526ea98941861059604ae326247b6a827 (diff)
downloadleetcode-725a6a2c9ab947c32543bccc15aca2ca966c857b.tar.gz
leetcode-725a6a2c9ab947c32543bccc15aca2ca966c857b.zip
add 2d array helper functions
Diffstat (limited to 'leetcode.h')
-rw-r--r--leetcode.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/leetcode.h b/leetcode.h
index 0c0794b..cc01748 100644
--- a/leetcode.h
+++ b/leetcode.h
@@ -9,6 +9,8 @@
#include <stdlib.h>
#include <string.h>
+#pragma once
+
#ifdef __cplusplus
#include <bits/stdc++.h>
using namespace std;
@@ -46,6 +48,12 @@ public:
};
#else //__cplusplus
+struct two_d_arr {
+ int row_size;
+ int *col_size;
+ int **arr;
+};
+
struct ListNode {
int val;
struct ListNode *next;
@@ -63,6 +71,10 @@ struct Node {
struct Node **children;
};
+void two_d_arr_init(struct two_d_arr *obj, int row_size, int col_size,
+ int arr[row_size][col_size]);
+void two_d_arr_free(struct two_d_arr *obj);
+
struct ListNode *listnode_create(int val);
void listnode_print(struct ListNode *head);
void listnode_free(struct ListNode *head);