diff options
author | Jack Sangdahl <[email protected]> | 2024-10-19 13:08:08 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2024-10-19 13:08:08 -0600 |
commit | 725a6a2c9ab947c32543bccc15aca2ca966c857b (patch) | |
tree | 9b082336500d640f08962891ffb12b86e0d5aa82 /leetcode.h | |
parent | 2d28c29526ea98941861059604ae326247b6a827 (diff) | |
download | leetcode-725a6a2c9ab947c32543bccc15aca2ca966c857b.tar.gz leetcode-725a6a2c9ab947c32543bccc15aca2ca966c857b.zip |
add 2d array helper functions
Diffstat (limited to 'leetcode.h')
-rw-r--r-- | leetcode.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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); |