removes a bunch of stuff:
This commit is contained in:
parent
dbfc40b6bd
commit
2eef292083
|
@ -1 +1,6 @@
|
||||||
node_modules/*
|
node_modules/*
|
||||||
|
*.exe
|
||||||
|
*.pdf
|
||||||
|
*.obj
|
||||||
|
*.ilk
|
||||||
|
*.out
|
|
@ -3,7 +3,7 @@
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"label": "C/C++: cl.exe build active file",
|
"label": "C/C++: build active file",
|
||||||
"windows": {
|
"windows": {
|
||||||
"command": "cl.exe",
|
"command": "cl.exe",
|
||||||
"args": [
|
"args": [
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
typedef struct ArrayList {
|
||||||
|
int capacity;
|
||||||
|
int index;
|
||||||
|
int data[];
|
||||||
|
} ArrayList;
|
||||||
|
|
||||||
|
ArrayList* new_arraylist(int cap) {
|
||||||
|
ArrayList* arr = malloc(sizeof(ArrayList) + cap * sizeof(int));
|
||||||
|
arr->capacity = cap;
|
||||||
|
arr->index = 0;
|
||||||
|
for (int i = 0; i < cap; i++) {
|
||||||
|
arr->data[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void push_to_array(ArrayList* s, int v) {
|
||||||
|
if (s->index == s->capacity) {
|
||||||
|
printf("you attempted to insert %d, but array is at capacity cannot add mode values\n", v);
|
||||||
|
} else {
|
||||||
|
s->data[s->index] = v;
|
||||||
|
s->index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pop_from_array(ArrayList* s) {
|
||||||
|
if (s->index == 0) {
|
||||||
|
printf("there is nothing to remove!\n");
|
||||||
|
} else {
|
||||||
|
s->index--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct BinaryNode {
|
||||||
|
int value;
|
||||||
|
struct BinaryNode* left;
|
||||||
|
struct BinaryNode* right;
|
||||||
|
} BinaryNode;
|
||||||
|
|
||||||
|
BinaryNode* new_binary_node(int value) {
|
||||||
|
BinaryNode* node = malloc(sizeof(BinaryNode));
|
||||||
|
node->value = value;
|
||||||
|
|
||||||
|
return (node);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
return (0);
|
||||||
|
}
|
|
@ -91,7 +91,6 @@ void remove_at_end(LinkedList* list) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int get_length(LinkedList *list) {
|
int get_length(LinkedList *list) {
|
||||||
return (list->length);
|
return (list->length);
|
||||||
}
|
}
|
||||||
|
@ -181,11 +180,7 @@ int main() {
|
||||||
print_list(list);
|
print_list(list);
|
||||||
remove_at_end(list);
|
remove_at_end(list);
|
||||||
print_list(list);
|
print_list(list);
|
||||||
|
|
||||||
int first_node_val = get_val(list, 1);
|
|
||||||
printf("the value at the first node is: %d\n", first_node_val);
|
|
||||||
destroy_list(list);
|
destroy_list(list);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
c/vc140.pdb
BIN
c/vc140.pdb
Binary file not shown.
Loading…
Reference in New Issue