Understand and Implement a Binary Search Tree in C

preview_player
Показать описание
---

Understand and Implement a Binary Search Tree in C // More trees folks. Building on my earlier example, this video explains what binary search trees, how they work, and shows you how to implement your own in C. I also discuss why balanced trees are faster than imbalanced ones.



***

Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.

About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.

More about me and what I do:

To Support the Channel:
+ like, subscribe, spread the word

Рекомендации по теме
Комментарии
Автор

Yes 🙌 AVL trees please! I learned them in python about a year ago at University. All I remember is that rotations are cool 😎

cobiebeef
Автор

Given importance of balancing for ensuring the desired performance for binary trees, I would love to see future videos about balancing techniques (including AVL / red-black trees). Thanks so much! this is a great intro!

vsufnyz
Автор

honestly the best programming videos on yt

pseudopseudo
Автор

I've looked through your video list and couldn't find any other tree videos. I think you should do one where you show people how to insert or search the tree without using recursion since those operations are dead simple written iteratively. I also think you should show people how to balance a tree and iteratively walk a balanced tree, as well as explain why you don't want to recursively walk a tree that's gone linear because you may overflow the stack.

anon_y_mousse
Автор

Jacob,
Your explanation of the topic is very good. Please make the session on the Red-black tree.

r.naveennaidu
Автор

You are a cool dude, videos are low-key relaxing. Thanks for putting stuff out for us people. <3

Sooky
Автор

Great video! I haven't worked with trees since my college days. lol Thanks for posting!!!

TheCocoaDaddy
Автор

very informative video, I need to know more about AVL tree

minaessam
Автор

can you make videos about heaps and graphs (dfs, bfs) as well please..and yes for self balancing tree!!! Cheers

adhipta
Автор

in this situation how you free the heap memory?

Adrian-Carstea
Автор

I would like to see the mentioned variations of the tree and I would also like to see you talk about the huffman coding tree

blankspace
Автор

Hi there, I would be awesome if you did a video about a, b trees and red-black trees

alejandropoirier
Автор

Yea, RB trees would be very useful, thanks!

finmat
Автор

How about maybe parallel programming for C/C++ tutorial? There's plenty of them out there for python but I can't find any reasonable ones for C/C++.

MrAman
Автор

I wishe I had this video 2 years ago back at the uni 😅

Psztyk
Автор

I've done so many problems with binary (and binary search) trees for interviews and the like, but I've never really seen a use for them outside of java map implementations, which use red black trees as far as I can recall. Are there any uses for these guys in the low level embedded systems work you do?

Brettyoke
Автор

You don't need to use recursion on the insert function. What you can do instead is to simply create a local pointer, say called current, and set current = root, then use a loop to walk current down the tree, until you either find the correct place to insert the value or a place where the value already exists in the tree, and then do the rest from there.

islandcave
Автор

It seems like you didnt include removeNumber function though, which is important in a BST

redditapocalypse
Автор

Hey Jacob, i have a little doubt will u clarify?..the doubt is where we wrote the concept of level i mean how the values is moving without we initialise them like if greater go to right and if lesser go to left in printtree_rec function....

dragshooter
Автор

I think we can avoid double pointers if we return the rootnode created.
Using double pointers we are using some kind of pass by refference so we don't need to return anything.
Correct me if i am wrong

kz_cbble