Тёмный

Map in C++ with practical examples - step by step Data Structures tutorial 

CodeBeauty
Подписаться 285 тыс.
Просмотров 116 тыс.
50% 1

Наука

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 228   
@CodeBeauty
@CodeBeauty 2 года назад
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time.
@brandonblackwell1216
@brandonblackwell1216 2 года назад
Finally a map video from you ! Ive been waiting for this !
@ILGiullareDiCorte
@ILGiullareDiCorte 2 года назад
I want to add a note. std::map is implemented like a red-black tree (a type of balanced tree, that's why the "map" is sorted). This means that insert, search and remove are O(log(n)). std::unordered_map is implemented like a hash table (with buckets) and insert, search and remove are amortized O(1). So choose well, because the 2 data structures are really different and have huge difference in performance. Btw great video and thanks for sharing your knowledge to people that are learning c++ ^^
@jeanehu-pludain6640
@jeanehu-pludain6640 2 года назад
log(n) for search ?
@abdelaziz4329
@abdelaziz4329 2 года назад
I have learnt English from you by practising of listening 😂
@akashkumarprajapati9874
@akashkumarprajapati9874 3 месяца назад
😂😂😂
@palmtrees9474
@palmtrees9474 2 года назад
Hvala na videu! Prelepa si Saldina! Respekt! Pozdrav iz Srbije!
@software2171
@software2171 2 года назад
#include #include #include using namespace std; /* After Reading 'MAP in C++', thought about Google Map in C++..finally understand, could not search codebeauty location in this map.. :D */ void fruits(){ map dic; dic.insert(pair("1 kg apple", "die fruits ")); dic.insert(pair("11 kg orange", "living fruits")); dic.insert(pair("7 kg berry", "newborn fruits")); dic.insert(pair("6 kg banna", "unborn fruits")); for (auto p : dic) cout
@kishensharma5651
@kishensharma5651 2 года назад
This was a very concise implementation of maps in C++, thank you again for creating the tutorials that you do
@CodeBeauty
@CodeBeauty 2 года назад
You are welcome! ☺️🥰
@canhobby6286
@canhobby6286 2 года назад
I was looking for C++ associative arrays like in PHP, and you showed me how - AND, many thanks for the black background from you blind Canadian subscriber..
@SibiAkaManiek
@SibiAkaManiek 2 года назад
One of the most common situation is to erase element while iterating in the loop. In that case is so close to make mistake ;)
@ethangold4900
@ethangold4900 2 года назад
15:55, yes I confirm that scary face is an attack, an attack that is supposed to scare the opponent with a scary face, this will lower the opponent's speed stat in battle
@CodeBeauty
@CodeBeauty 2 года назад
Thank you for clarifying this! 😁🔥🔥 I also did some research and after seeing Charmander's scary face myself, I was stunned and terrified! 😁 I hereby testify that everything stated in the video and in this comment is correct! 😏😁
@Sssilence3
@Sssilence3 2 года назад
Always love ❤❤❤ your videos.. Please make a video of “bit manipulation”... 🙏🙏 I see lots of video of bit manipulation, but can't understand properly. 🙁🙁 So please please one video of bit manipulation.
@thebadluckraven8217
@thebadluckraven8217 2 года назад
I love all your videos and now i can comprehend what im doing much better than any of the books ive read. If you could make a video on Vectors i would greatly appreciate it ! Thank you for everything you do!
@neepunpatil5201
@neepunpatil5201 2 года назад
Full DSA course ma'am please 🥺 I understand much better when you teach
@remysalone
@remysalone Год назад
I beg for the same.🥺
@JMac___
@JMac___ 5 месяцев назад
u should discuss the underlying structure of the map and its implementation as well.
@SA-oj3bo
@SA-oj3bo 2 года назад
How to make an API request with C++ and handle the JSON response? Is there an alternative for JS parse and stringify or Python Loads en Dumps?
@itx-zulqar
@itx-zulqar 2 года назад
Thanks
@yuhuili6738
@yuhuili6738 Год назад
I gotta say this! When I learned about OOP, I subscribed to this channel and RIGHT NOW! My professor just put the link of this video in this weekreading schedule! Amazing. Thank you so much for the explanation!!!
@CodeBeauty
@CodeBeauty Год назад
Your professor is awesome, he really cares about teaching, give him my greetings! 🥰 Most of my professors would just give us a book with a bunch of abstract examples and students had to figure it out on our own. It took 5x more time 🥲
@program5004
@program5004 2 года назад
welldone dear saldina😍😍.......i have an order could you solve this question for me...?write a c++ program that calculate the number of (day)s between two date using class??
@diwasbajracharya3745
@diwasbajracharya3745 2 года назад
Its surprising that I was just searching for maps and here we are!!!BTW done with both yours and caleb's 10hr c++.Thanks to you, its becoming easier than I expected.
@CodeBeauty
@CodeBeauty 2 года назад
I'm happy to hear that! ❤️🤗
@gbaransano7070
@gbaransano7070 2 года назад
can you also please do a tutorial of C++ GUI login & registration form done in Visual Studio Code 2019 with an SQL database? Thanks in advance :)
@hosseinbachari6732
@hosseinbachari6732 День назад
Thanks a lot Saldina , if we want to translate from string to for example integer or other variables what should we do and I am wondering whether in practical projects are detas from different kind of variables converted on base of this way or not , for example, audio to text or text to image, etc
@lightspd714
@lightspd714 Год назад
Great presentation style, very informative! Also, pikachu is my fav
@OlliS71
@OlliS71 16 часов назад
The code is inefficient because the insert copies the pair'd strings. Use emplace to construct the pair in-place in the tree.
@あい-ueo
@あい-ueo 5 месяцев назад
I was confused by my professor's explanation and videos in RU-vid but eventually found out this one to be very straightforward and easy to learn, thanks a lot!!
@almighty1984
@almighty1984 2 года назад
The Swedish word for strawberry means old man from the earth
@CodeBeauty
@CodeBeauty 2 года назад
hahahaha 🍓👴🌍
@SivasaiPrime
@SivasaiPrime 2 года назад
Wow...I loved it....taking examples of pokemons and their attacks..is awesome...brings my childhood memories ❤️❤️❤️
@CodeBeauty
@CodeBeauty 2 года назад
🥰🥰
@abdourahamanediallo8877
@abdourahamanediallo8877 2 года назад
I watch your videos and enjoy them very much. please can you make a video of a C++ programming project which covers all or almost all the themes of the C++ language
@CodeBeauty
@CodeBeauty 2 года назад
Thank you, I will! ☺️🤗
@bearwolffish
@bearwolffish Год назад
lol Squirtle, Ghastle and Mewto.
@amodpatwa1822
@amodpatwa1822 2 года назад
You are amazing Saldina, this video was very nice. I prefer mostly unordered map over ordered map. And don't feel awkward about your favourite pokemon if you are 26, I'm 27 and my favourite pokemon is Pikachu ❤️ because he is very cute and sometimes very aggressive if he don't like anything
@gbaransano7070
@gbaransano7070 2 года назад
You are no weirdo if I may say... :) My son is 7 years old and crazy of Pokemons and collects the pokemon cards... Actually I am joining and assisting him in that and I am 45 years of age :)
@gbaransano7070
@gbaransano7070 2 года назад
I'm so glad you give others like I the opportunity to learn stuff made so easy from the way you do it. I'm so happy! Thanks for your reply... ❣
@mateoslab
@mateoslab 2 года назад
i just learned about c++ containers 2 days ago so this video helps! How is a list different from a normal array? would it work to have a string array as the second data type of the map?
@ChrisCarlos64
@ChrisCarlos64 2 года назад
One of the key differences is an array is fixed size versus a list that can grow and shrink in size. List, like other std containers (vector, queue, etc) know their size and have operational functions to get items at position, front, end, iterators, and so forth. When using normal arrays you cannot know the size, unless you use std::array which has some features like std containers, however array is still fixed size. Maps can hold any type of data for their keys and values. If you want the second to be string array, you can do that. Just remember that your string array has to be fixed in size or if you use a container it can grow and shrink over time, so it matters on what you need. You just need to think about what use would that array be for? Because the key gives you access to the array, but now accessing the elements in your string array requires some other search (like iterating and comparing the values).
@Only-zeus
@Only-zeus 2 года назад
Hey please upload tutorial play list about web development using C++
@prigithjoseph7018
@prigithjoseph7018 2 года назад
Hello do you have any plan for converting all your videos into book? You have created amazing videos friend.
@aruneshsingh5698
@aruneshsingh5698 2 года назад
The way you explain these topics is very fascinating. Please make videos on heaps , hashing and other data structures
@devmarboy4045
@devmarboy4045 Год назад
for some reason when i try unordered_map it still prints out in order - can someone help please lol
@mulumbacephas5036
@mulumbacephas5036 2 года назад
I was searching for copper and i ended up find gold nice vid
@Noah-357
@Noah-357 2 года назад
Bro, I hate the damn ::std. Its literally make the code complex and unreadable when every time is being used in the code std::cout and std::string 😑 and in every part of the code. Instead of looking at the code, your eyes will stuck at the word ::std.
@CodeBeauty
@CodeBeauty 2 года назад
I kinda agree, that is why I don't use it in most videos, i just put using namespace std;
@kaankutlu1414
@kaankutlu1414 2 года назад
My favorite Pokemons also pikachu and charmender bu also I have liked Balbazar and Squiertel
@CodeBeauty
@CodeBeauty 2 года назад
Charmander and Chikorita are my fav 🧡 💚
@Roseasuko
@Roseasuko 2 года назад
My favorite pokemon is a legendary, darkrai XD
@mrlectus
@mrlectus 2 года назад
Where is the practical example?
@truecodeface
@truecodeface 2 года назад
Thanks a lot from your clean codding , clear speaking , and you always brings each and every point from sidelines to TEXT. I 💕💕💕 your Instructions always. but i wish to become a close colleague for you in the area of coding and programming for ever. so please try your best for shifting me from Afghanistan to your Homeland (Boss AND Herz).i want to work with you, i like working with you.
@monstergamingiraq7927
@monstergamingiraq7927 2 года назад
Finally a new video ...Thanks a lot i really appreciate your efforts❤️
@AbdullahKhan-mx6pp
@AbdullahKhan-mx6pp 2 месяца назад
Great Video
@begueivan3799
@begueivan3799 2 года назад
You should explain how you set up your external terminal
@RoboticsWithHrithik
@RoboticsWithHrithik 2 года назад
I was searching for this video finally its here 👍
@rohitcr2k
@rohitcr2k 2 года назад
Your channel is a treasure for (budding) programmers. 💜
@luisalamo2658
@luisalamo2658 2 года назад
Btw my 3 favorite Pokemon are Charizard, Blastoise and Zapdos
@manjokesharwani148
@manjokesharwani148 2 года назад
Please Can you make some sdl2 tutorials? Please 🙏😀 I saw your others tutorials and I like them so much. 👍😃
@iqrajaved3593
@iqrajaved3593 2 года назад
Your videos are very helpful for us.please keep it up.. your videos also improving our English.Thank you 🥰
@maheshvelugula8418
@maheshvelugula8418 Год назад
I watch daily pokemon series videos, the way you explain and the example taken is very good, nice, thank you. 🥰😉
@fatehpreetsingh1440
@fatehpreetsingh1440 2 года назад
Thank you for this tutorial
@CodeBeauty
@CodeBeauty 2 года назад
You're welcome ☺️😺
@kamertonaudiophileplayer847
@kamertonaudiophileplayer847 2 года назад
Thanksgiving? Tons of people celebrate this wonderful autumn holiday. But what if you need to finish this damn project? Right, just open the video and you will answer to the question you tried to resolve for weeks. Bravo!
@CodeBeauty
@CodeBeauty 2 года назад
Happy holidays! 🤗🎊❤️
@kamertonaudiophileplayer847
@kamertonaudiophileplayer847 2 года назад
@@CodeBeauty Thanks.
@gobybike5016
@gobybike5016 2 года назад
I wrote my own map facilities about 12 years ago before I knew STL has map. I could’ve saved a lot of time if I knew about the built in map features. I learned a few things from your video. Thanks.
@CodeBeauty
@CodeBeauty 2 года назад
😁🤞🥰🥰
@neepunpatil5201
@neepunpatil5201 2 года назад
Finallly Completed your OOP C++ course
@artemioharoldperlaciosluqu5471
@artemioharoldperlaciosluqu5471 2 года назад
Me encantan tus videos, muchas gracias :D
@Bodybuilder900ml
@Bodybuilder900ml 2 года назад
Can you do a video tutorial on establishing a web socket connection with the Kraken cryptocurrency exchange API???? Please 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
@moatazcraft1310
@moatazcraft1310 2 года назад
Can you do a topic about templates
@CodeBeauty
@CodeBeauty 2 года назад
Can this help? ☺️ ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qrJjFN4Igfw.html
@superfloyd
@superfloyd 2 года назад
tip : if the type is too complicated for readability, such as an iterator or a standard library type, then auto&& will magically bind to anything always.You can use it in for loop.
@MystoCalypto
@MystoCalypto Год назад
your german pronunciation is so good
@nicholaskomsa1777
@nicholaskomsa1777 5 месяцев назад
Thank you for your interest in the topic of Modern C++. However, your code is depreciated. Learn to do: std::map myDictionary = { {"name", "John"}, {"surname", "Doe"}, {"age", "25"} }; for (auto& [id, value] : myDictionary) std::cout
@itx-zulqar
@itx-zulqar 2 года назад
Thanks .....10hr C++ video. very very thanks
@CodeBeauty
@CodeBeauty 2 года назад
🥰🥰
@itx-zulqar
@itx-zulqar 2 года назад
So helpful this channel
@ajitpatil6532
@ajitpatil6532 2 года назад
I love how this video is on point and precise. Your C++ vids are great.
@jeanehu-pludain6640
@jeanehu-pludain6640 2 года назад
miss how verify a key... (count) C++20 u can write : for (auto const &[key, value] : yourmap) ... I don't understand why c++ insert method is sooooo weird...
@francescobattaglia5322
@francescobattaglia5322 2 года назад
Hi, why do you always change program from Embarcadero to Microsoft? It's very difficult to me to follow the lessons!!! Sorry for my bad English...
@hil449
@hil449 2 года назад
code beauty indeed. You're gorgeous! And my favorite pokemon would be salamance most likely. But from gen 1 i think my favorite would be articuno. Its really difficult, gen 1 has so many great pokemon lmao
@ashishgusain9494
@ashishgusain9494 2 года назад
Best video i have ever watch for string example.
@amrrasslan4329
@amrrasslan4329 Год назад
you made a long story short . thank you for being to the point without a long introduction hats off to you :)
@mmuzzammil8394
@mmuzzammil8394 2 года назад
Thank you. Video was helpful and clear!
@diegocamposjimenez666
@diegocamposjimenez666 Год назад
I'm 30 and still play sometime. Sceptile and Bulbasaur. When I stopped playing at 16:19 I was doing the same laugh. Also, could you add one more video about linked lists of a linked list? Two dimensional list for dictionaries where if user adds "car" it adds it in the other lists from A to Z and sort it. If I remember where this comment is, I'll add my code as well.
@CesarAugustoRL
@CesarAugustoRL 2 года назад
Very useful video, thank you!
@SillyCatto
@SillyCatto 2 года назад
Thanks a lot for such an easy and perfect explanations, also with interesting examples!😊 Helps me a lot. We'd also love to have a video on set data structure please 🙂
@austingrapes5455
@austingrapes5455 Год назад
Using the pokedex example makes the lesson that much more fun.I really don't think scary face is an actual attack, I believe google is wrong, but it might be an attack in the newest versions.
@d_113d
@d_113d 2 года назад
❤️❤️❤️
@omparghale
@omparghale 2 года назад
Arceus Charizard Greninja Dont worry,you're not the only adult pokemon fan out there
@muhanadglb8881
@muhanadglb8881 2 года назад
You are my hero in C++ .......👍👍👍👍👍
@CodeBeauty
@CodeBeauty 2 года назад
☺️🥰🥰
@muhanadglb8881
@muhanadglb8881 2 года назад
keep going in these videos. ..... it's really useful .
@AudreyGraceB
@AudreyGraceB 4 месяца назад
Wow, great video, I'm glad I've just found your channel!
@ozzyable
@ozzyable 2 года назад
Damn she's German, cool
@drsumankhanal
@drsumankhanal 10 месяцев назад
You teach so cool. Easy to follow? Can you make one on AVL and RB trees? How to create AVL trees, traverse?
@richardfoster4385
@richardfoster4385 9 месяцев назад
I am just curious why you use insert instead of emplace to add a pair
@Advanced_Programming
@Advanced_Programming Месяц назад
Thank You
@ujjwalsharma3953
@ujjwalsharma3953 2 года назад
Actually, scary face is an attack that is used to reduce the speed of the opposing Pokémon in a battle
@mohammadasaad885
@mohammadasaad885 2 года назад
what do u think about problem solving ?! how can we learn it ? thx so much for ur videos .
@yairfink2368
@yairfink2368 2 года назад
thanks for all your videos, really like this program.
@CodeBeauty
@CodeBeauty 2 года назад
You're welcome ☺️🤗
@bernardseno2535
@bernardseno2535 2 года назад
Great! I have been looking for a great tutorial about map and there you are Ma'am! Thank you!
@j.rayscott4681
@j.rayscott4681 2 года назад
Great video as always! I have a question. Since the declaration of map includes, in your example, string and string why when you do the insert do you have to say string and string again??
@TheHatMusic
@TheHatMusic 2 года назад
If you have a map which uses string as the key and string as the value, the map is able to store objects, and those objects must be a pair containing two strings (pair). When you create that pair, you need to define what data it stores, so by passing string and string to pair when it is created, you specify its type just as you do when creating the map, and as the types stored by the pair match the types accepted by the map, the insert operation will succeed. If you don't want to explicitly create a pair then add it, you can call emplace on the map and pass in the strings, and c++ will create the pair for you -ie. myDictionary.emplace("banana", "die Banane");
@pavankumarnitta0329
@pavankumarnitta0329 2 года назад
Can you please post a full detailed long video on below two topics: Data structures using C++ STL using C++
@sarahalahmad9496
@sarahalahmad9496 2 года назад
💕💕💕💕 thanks a lot !
@MatildeOliveiraSilva-qi3kb
@MatildeOliveiraSilva-qi3kb 3 месяца назад
hi! what if i want to list strings in the terminal instead of writing it already... if i dont have an certain name
@bitte929
@bitte929 10 месяцев назад
My favourite pokemon : Psyduck 😂😂
@integrate2945
@integrate2945 2 года назад
Can you please bring course on CORE JAVA+OOP concepts on JAVA please!!I mean full JAVA course from begginers to advance learners. 😭😭😭 You are the best🥰🥰🥰.
@hypergengar5130
@hypergengar5130 Год назад
My favourite pokemons are Gengar and Wobbuffet
@luisfernando3405
@luisfernando3405 Год назад
Is very good video to learn about this topic; Good job, 🎯
@sawomirbartoszko9385
@sawomirbartoszko9385 2 года назад
interesting understandable consise without beating around the bush excellent
@rushabhjain9158
@rushabhjain9158 2 года назад
QUICK , PRECISE AND EASY !
@hbw4449
@hbw4449 Год назад
are you German?
@TheHatMusic
@TheHatMusic 2 года назад
Why would you call insert rather than emplace with the two values - ie. myDictionary.emplace("banana", "die Banane"); ? Is there a practical reason, or is it purely coding style?
@milo20060
@milo20060 2 года назад
I briefly remember on some random slide show in my second year uni about the maps. The teacher talked quite fast and I didn't pick it up. But now I kind of got it! Thanks! Oh and my favourite Pokemon. Well what first comes to my mind would be Charmander and it's final form Charizard. Used to have one as a soft toy ^^
@aswin6261
@aswin6261 Год назад
thank u sister
@siddharthqs
@siddharthqs Месяц назад
You must not use [ ] operator to access the elements in maps. It has lot of issues.
@Autodidact-t5c
@Autodidact-t5c Месяц назад
Haha. Im 32 and my favourite Pokemon is probably Mewtwo from the first movie. But apart from that, Sneasel and Steelix
@CodeBeauty
@CodeBeauty Месяц назад
Hahahaha, I'm 29 currently, and my favorite is Vulpix 🔥😁
Далее
Back To Basics: C++ Containers
31:41
Просмотров 184 тыс.
Hash Tables and Hash Functions
13:56
Просмотров 1,6 млн
Map In C++
13:54
Просмотров 138 тыс.
Maps in C++ (std::map and std::unordered_map)
30:00
Просмотров 214 тыс.
Learn Any Programming Language In 3 Hours!
22:37
Просмотров 421 тыс.