Freeing (or deallocating) a Binary Tree in C

  Рет қаралды 440

CodeVault

CodeVault

Күн бұрын

Source code can be found here:
code-vault.net...
===== Support us through our store =====
code-vault.net...
===== Check out our website =====
code-vault.net
===== Check out our Discord server =====
discord.code-v...

Пікірлер: 10
@vilijanac
@vilijanac 3 күн бұрын
I know all this, hence not given job so moved to Perl language.
@CodeVault
@CodeVault 3 күн бұрын
I can only respect people that work in Perl. It seems like such a strange language
@playingnumber
@playingnumber 3 күн бұрын
Please make a video on valgrid
@CodeVault
@CodeVault 3 күн бұрын
I will add it to my list. Thanks for the feedback!
@CedLePingouin
@CedLePingouin 10 сағат бұрын
Regarding the situation explained at 3:39, is it really necessary to iterate over the queue (array) backwards, since we iterate over that array at the end of our function, and the array already contains all the "nodes", which are essentially pointers ? Since free() only needs an address/pointer in order to deallocate the memory/object associated with it, and we have all of them in that array (meaning we didn't lose any references/adresses to the nodes in the process), does the order in which we free all pointers really matter ?
@CodeVault
@CodeVault 10 сағат бұрын
Oh, you are actually right about that. EIther direction of iteration works in that case as long as you always iterate over the whole array
@DanielMartensson-x3l
@DanielMartensson-x3l 3 күн бұрын
Can you show how to use GTK+ in C or OpenGL in C :)
@CodeVault
@CodeVault 3 күн бұрын
I'll look into it
@DanielMartensson-x3l
@DanielMartensson-x3l 3 күн бұрын
@@CodeVault You have a high skill in memory management. One option is to connect that knowledge to real short projects such as 3D rendering or GUI development because then memory management will come in handy. :)
@CodeVault
@CodeVault 3 күн бұрын
As a matter of fact I have already created my own "game engine" in C around 6 years ago. It's a basic clone of the game Minecraft, but only has some of the basics implemented there. It's not really finished. I was thinking of making a series where I try to port it to Rust and see how that goes
Depth-first search for Binary Trees in C
16:20
CodeVault
Рет қаралды 765
Compiler Q&A, September 2024
2:10:03
Jonathan Blow
Рет қаралды 23 М.
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 71 МЛН
Breadth-first search for Binary Trees in C
13:14
CodeVault
Рет қаралды 334
Enter The Arena: Simplifying Memory Management (2023)
1:47:50
Ryan Fleury
Рет қаралды 41 М.
What are variadic functions (va_list) in C?
13:49
CodeVault
Рет қаралды 21 М.
Mining Magnetite
16:20
Cody'sLab
Рет қаралды 307 М.
I regret doing this...
1:20:07
Tsoding Daily
Рет қаралды 74 М.
Introduction to Tree Data Structures in C
11:48
CodeVault
Рет қаралды 1,3 М.
This Library Turned my C into JavaScript wtf
2:06:38
Tsoding Daily
Рет қаралды 35 М.
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 71 МЛН