How to Create a Dictionary in C

preview_player
Показать описание
Implementing data structures in the C programming language.

The dictionary is an unordered collection of key/value pairs, and one can be implemented in C using a binary search tree. To accomplish this, we will need to utilize concepts of object oriented programming.

This project is part of an open source library of tools available for download on GitHub:

Geeks for Geeks Article:

00:00 - 04:12 What is a dictionary?
04:13 - 10:35 Entry Object
10:36 - 18:09 Dictionary Object
18:10 - 27:52 Insert and Search
27:53 - 30:13 OOP in C
Рекомендации по теме
Комментарии
Автор

thanks for these videos. Hope you come back anytime soon with new projects and tutorials!

philipphortnagl
Автор

Well-presented and well-spoken, thank you

jahoopyjaheepu
Автор

That Washington OOP in C paper is really good

vitorsantos
Автор

Thank you. Kind note - larger font could be helpful for easier viewing/following.

richardrogers
Автор

27:45 I don't understand how it converts a void pointer (result) to a struct Entry pointer. how does it work? I am confused. struct has 2 pointers but result is only one pointer so i donno how it is possible to cast it. Very in depth tutorial though 👍

itspurelypassionate
Автор

jeez louis. Just started "learning" C this weekend by doing last year's Advent of Code and wanted to implement a dictionary. I paused the video at 9:04 and googled for a good 15 minutes why you were placing the function declarations in the header file. The next words to come out of your mouth were regarding that very subject lol

BabyBallascore
Автор

10:30 : why are you using free(entry) ? entry was not created with malloc in the constructor

Brad_Script
Автор

Hmmm. The advantage of a dictionary style data structure is to make access of an element O(1). So using a binary search tree instead of a hash function defeats the entire purpose. You're simply adding syntax sugar on top of a binary search tree.

bonehelm
Автор

If you use hashmap it will be O(1) for search why do you find O(long n) more efficient?
P.s: i have not watched until the end yet

alirezabahrami
Автор

I came to watch this video as I'm stuck with my college programming homework

shahil__malik
Автор

This IDE looks cool, which one is it and how hard is it to get familiar with it? Using Code::Blocks at the moment but I am not sure how happy I am with it, so I constantly looking for other interesting IDEs to toy around with until I find the one that fits me the most.

dracorep
Автор

Have you considered using hashing for your dictionary? It would be faster than a bst based implementation.

ed