This will be an ongoing series. I know it is a bit different than the projects/crash courses I usually do, but it is really good practice. I will be reviving the JS Cardio series as well. Maybe do some Codewars :)
@tomershechner4 жыл бұрын
I'll just lay a couple of DSes ideas for your next videos: - Hash tables (associative arrays, aka maps) - Dynamic array (aka vectors) - Binary trees - Queues - Heaps - Sets I implemented them all in C once, it'll be cool to see you using a language other than JS, something which is closer to the metal, like C, Rust or even Go. Peace Brad, I appreciate the effort you put into your videos!
@swanstudios20184 жыл бұрын
Traversy Media love some code wars that would be a nice mix of content! Thanks so much brad!
@khotambakhromov4 жыл бұрын
how the method pop removes element? tbh, I couldn't find out how it works and deletes item
@Buyilehuorg4 жыл бұрын
shouldn't we add this.items.pop() inside pop method? otherwise it's kinda still there, no? Could you please make examples how to use those with real world implications? I mean examples explaining why we want to use it instead of arrays for instance etc. Thank you very much for your videos and Udemy courses
@princesiful4 жыл бұрын
great
@Ath93944 жыл бұрын
Really happy that brad started data structure series
@ryan.aquino4 жыл бұрын
Please continue this series: data structures and algs. Include stack, queues , heap , graph , trees. You explain things simpler than others ! Thanks. Edit: Include atleast 1 coding problem And 1 realworld example.
@uchechukwuprincenwulu20264 жыл бұрын
im in support with his comment
@michaelolukaka4 жыл бұрын
waiting for the next data structure...good stuff
@EngerJimenez4 жыл бұрын
I support this.
@toberixng4 жыл бұрын
that is the honest truth
@EntwistleOx4 жыл бұрын
support!
@safara_umarov4 жыл бұрын
Really! You are great teacher in the KZbin I'm from Tajikistan and I started learning programming with your videos and now I know many many things. Thank you my brother❤)). With our language not one video about programming and I don't know English good! Your videos help me very. Thank you again
@mannyc10654 жыл бұрын
I'm taking a data Structures course at school next semester so this is perfect timing!! Thank you!
@iamjameswong4 жыл бұрын
Hey, nice vid. If I understand it correctly the `.pop` method merely reduces the reference count instead of actually removing the item from the list/stack. Is that right?
@srdjagunjic4 жыл бұрын
Same...
@jeromesnail4 жыл бұрын
The way the stack works, it is exactly like the item was removed from the stack, even if it is still in the items array. Because we're not supposed to access items from outside of the class.
@greenie624 жыл бұрын
ya i was thinking that too and playing around to try to 'break it'...i realized and am curious for someone to confirm, but in this instance pop feels like its.a rewrite method rather then a remove...by that i mean, it gives us the value but rather then remove it, it just backs the counter up one so the next item we push(), it will then overwrite it as its being given the same index value. so, if you pop() and then look at the array right after, the item is still in there, but soon as you push, then its becomes 'gone' and your stack continues on with its indexed integrity. least thats my guess!
@augustodias89864 жыл бұрын
I just added this.items[this.count] = undefined after decrementing the count
@frankkevintankui72214 жыл бұрын
Same. 😅 It's a great mistake. We also have to manage the memory in data structure
@Unbridledhopebr4 жыл бұрын
Hey, I AM A BIG fan of your work. I can easily understand what you teach. thank you very very much for selling your courses at such an affordable price and outstanding quality. Hug from Brazil.
@tom.watkins4 жыл бұрын
Great video, only thing that I was surprised to see was the pop method not actually reducing the size of the internal array. Looking forward to the other videos in the playlist!
Wow thank you so much... I was not confident about DS before but now i am sure that i will understand everything.. Thanks, please upload all the vedios exlpaining all the Dta structures.!!
@ravijaiswal_74 жыл бұрын
Looking forward to the complete series of data structures and algorithms, the way you take the flow of your explanation makes things look very easy.
@andrei82994 жыл бұрын
Thanks for the video. Just today got to this topic while learning. It was interesting to know how the mothods structured
@mauricioreyes89124 жыл бұрын
Dude, Im coursing data structures in the collegue now, you have this skill to explain things really good. Keep going. Really great channel.
@eriktenecela71704 жыл бұрын
Bro thanks Traversy man I been telling people these DS/Algorithms are the most important thing to know before anything it will improve your programming mindset dramatically thanks again this channel truly is the best
@srivatsanramesh17394 жыл бұрын
Hello Brad.. I have a question. When you’re popping an element from the stack, the element doesn’t actually go out of the ‘items’ array right..? It’s still there. Though you decrement the ‘count’ variable... shouldn’t the element be actually going out of the array..? Do correct me if I’m wrong.
@dmitrydomanski7084 жыл бұрын
The same question I was going to make
@mykalimba4 жыл бұрын
Why does it matter? It is _effectively_ removed, from the perspective of whoever is using the API for this class.
@tanieltari45394 жыл бұрын
@@mykalimba It does matter - you are using less CPU cycles and so your code will be faster. Time spent will be actually noticeably lower, just test it yourself
@michaelwilson17714 жыл бұрын
Technically not a memory leak, although the array doesn't shrink after pop. Javascript makes it a little harder to create true leaks due to garbage collection. The array size will only ever be as large as the number of successive push items. After pop, those items will still be in memory, but future pushes will overwrite them. The element references aren't actually lost. Just technically not 'efficient' in memory usage. Push 100 items - array size == 100. Pop 100 items - array size ==100. Push 100 more items - array size == 100. Also keep in mind @traversymedia was just trying to demonstrate how a stack works. You could do this just as easily with a straight Array using unshift() and pop()
@rtorcato4 жыл бұрын
The next series will be how to deal with memory leaks
@jmmacatangay_grizzlybear4 жыл бұрын
It's really amazing how people come into your channel. It's about 21 minutes ago in my time and a hundred people seen it already. It's really amazing that a lot of people appreciate you. Been telling my friends about your channel. Really hoping you'll get a billion subscriber someday.
@paschalynukwuani69802 жыл бұрын
Thank you so much for this video. I really understood everything. I must say you are a good teacher. Love your content 💓
@Melanittanigra4 жыл бұрын
Please continue with this series, it is very hard to find information on algorithms and data structures in regards to JavaScript
@xXDameanXx4 жыл бұрын
Many thanks for creating this content and sharing this knowledge, algorithms, and design patterns are needed out there but no one is teaching them
@_rachid4 жыл бұрын
Thank you Mr Brad for this. By the way your course Javascript from the beginning on udemy is gold 👌 Greetings from Morocco 🇲🇦
@leod.93434 жыл бұрын
We want more data structures and algos ! Please Brad !
@GTsurwa4 жыл бұрын
So glad you are doing stuff like this Brad. Still yet to find a web dev job, so videos where I can keep learning really help keep motivated. Thank you 1000 times.
@MeTr1ckZUCSGO4 жыл бұрын
pop is not removing items from the stack, we just change 'count' pointer hiding the bug and potential memory leakage.
@indomitablelust4 жыл бұрын
I got a little confused here. Why is the pop method not actually removing the element from the stack? I was thinking that the original stack may still have all the pushed elements at the end but I'm not competely sure. Could someone please explain that part to me? Excelent content as always, keep up the good work, man.
@sushantkunkekar21554 жыл бұрын
One of the best and simple video on stack... Please Brad do videos on other data structures too. Likr hashtable , tree, dynamic programming
@joeyalfaro23233 жыл бұрын
im going to give you some real feed back i couldn't wrap my head around what code was doing slowly pieces came together at this point. i got captions on taking notes and hand writing examples. i wondered what numbers on side were and little screens. it slowly comes together throw more time at problem break it down step back really dig in.
@soumadip_banerjee4 жыл бұрын
Yaaayyy! Plz! Connect these data structure videos in a series! (small tip: Add some theory too). U're again, my hero in the Tech world! Thankeeww so much! I needed this! 💚
@AneesKhan-uz4mz4 жыл бұрын
I always feared data structures and algorithms but Brad you just explained really well now I'm loving data structures and algorithms ❤️❤️
@akiratoriyama13204 жыл бұрын
This is great tutorial sir!! You are helping with our computing thinking!! Thank you!! Hope you made a whole series on data structures because you explain things on simple way!!
@amalekilawlor29222 жыл бұрын
This pop doesn’t modify the items array, which isn’t a big deal, but you can also write the pop method as: pop(){ if (this.count == 0) return undefined; this.items.splice(this.count - 1); return this.count -= 1; }
@frugodwill2 жыл бұрын
Yeah I think he intentionally didn’t want to mutate the original array. More like the global array methods that don’t mutate original arrays
@feruttin4 жыл бұрын
Hi, you could start this.count = -1 and increment it before assigning. so there will not be mess with indexes.
@mudusugal4 жыл бұрын
your explanations are very clear and easy to understand. Thank you!
@annyudo2 жыл бұрын
Thank you so much, I really enjoy all your videos, the concepts you use and your explanations are very concise. You are a great teacher. Pls keep up the good work.
@jaleotech59184 жыл бұрын
pop in the example not actually removing anything.. if you con log items they are all still there. The only thing that is going on is the changing of the counter not the actual array..
@mykalimba4 жыл бұрын
Why does it matter? It is _effectively_ removed, from the perspective of whoever is using the API for this class.
@vegitax4 жыл бұрын
@@mykalimba no, it's not. It matters a lot because the values are still in the memory and only the 'pointer' moves and that's not how a stack should work. If this was in a production env somewhere it would undoubtly cause problems at some point.
@vegitax4 жыл бұрын
It bothered me for the whole video that the values were not deleted. I was waiting for the whole time for Brad to notice it because he usually does 😅
@kumarraja19894 жыл бұрын
Exactly, I am looking for the solution
@norricobiason58214 жыл бұрын
@@mykalimba you want to see how isn't popping element in the stack? insert this in pop() method let deleteItem = this.items[this.count - 1]; this.count -= 1; console.log(`${deleteItem} removed`); console.log(`${this.items}`);
@gihantharatnayake34114 жыл бұрын
Hey Brad. Pop doesnt actually remove the elements from the array. It looks correct cus the count value decreases. If you print the array at the end you will find all the elements are still there.
@maxhouseman31294 жыл бұрын
Pop does not really delete it from memory. It only decreases the counter, but in raw data the element is still existing.
@marufahmed73144 жыл бұрын
Right, the item is still there
@arjitamathur47184 жыл бұрын
Sir please teach all data structures and algorithms ! I am a learner from *INDIA* . I really like your videos and the way you teach. It's really helpful sir . It's a request that please make a data structure series in which we get in depth knowledge of the course .Thankyou Sir .. Really grateful to u !
@rezamarefat68944 жыл бұрын
Please keep making these kinda content brad. Your channel is incredible
@sujeetagrahari22924 жыл бұрын
I am so glad that you doing this. I have been following this channel very long. I don't come here often now. To be honest best channel for beginners to learn new techs. But code quality and best practices lack in this channel, and I don't think this should be a concern when you are introduced something new at first. But if you get a idea of things in the beginning, it will be lot more beneficial for newcomers..
@andrewiglinski1484 жыл бұрын
Dude I was just messing with react-navigator for react native when I saw this. As soon as I saw this I kind of pee'd a little from overwhelming excitement.
@timurgolovinov4 жыл бұрын
It would be great if you can also explain where they can be useful in real-world applications, please Brad!
@alexandrodisla62854 жыл бұрын
Data structure and Algo is very relevant in competitive programming. Big companies seems to need these skillsets. It makes you overall a better and efficient developer. For me data structure & algo + design patterns + all.i.dont.know.yet makes you write efficient program.
@adrian-47674 жыл бұрын
alexandro disla can all haitians speak French?
@RyanRoat4 жыл бұрын
The BaseCS podcast has a number of episodes on data structures. They provided a great description of the stack - a spring loaded dish stacker in a cafeteria. The cafeteria pushes the dishes onto the stack, and the diners pop them off when they queue up. Oh, look, there's another data structure. :) And yes, I'd like a look at tests to verify the stack is working as expected.
@abualmahadi80844 жыл бұрын
Now that you've started the series I'm already feeling confident about finally learning about the data structure and algorithm......sooo much love and respect
@santosokwadi4 жыл бұрын
Every Video this guys posts, I just click "Like" even before I watch. You have great content Man.
@HermanRas4 жыл бұрын
can't do full stack without understanding how to properly structuring the data, its the differences between complete redesign or adding and object... so love to see more video's in this style.. PS - there is a memory leak in the pop function, you are reducing the count number without removing the actual item :)... probably not a big deal but if you scale the function to a million and change out the numbers for large pictures... your node server will fall over and DIE..
@swarnalathavura13344 жыл бұрын
I'm new to this channel recently I joined but it's very nice waiting for more videos I'll support u
@TheCredibleHulk4 жыл бұрын
I might be wrong, but I think your pop() was lacking some essential garbage collection features. Cos until you clear() the stack, data is still all there in the items array, only the count changes. It might lead to some unexpected results + is just a waste of resources, if you have a large stack. The pop() function should get the top element + remove it from the array altogether.
@tom.watkins4 жыл бұрын
Great video. Only thing I was expecting was the pop method to reduce the size of the internal array
@jeanssmith58644 жыл бұрын
me too Really happy that brad started data structure series I will be right here waiting for Brad
@onedimensionalchess43734 жыл бұрын
Beautiful!! I’m about to get into this topic, so it’s nice to see my favorite teacher explaining it.
@TheKrisu983 жыл бұрын
You could also add: this.items[this.count] = null, So the previous number is not longer assigned to this array.
@bren.r4 жыл бұрын
It seems counterproductive to make a wrapper class for the built in methods of Array, besides syntactic sugar, at the expense of more memory allocation as you’re not letting the stale elements to be garbage collected as your example shows.
@eduriseworld4 жыл бұрын
Awesome awesome. I'm going to start videos on Leetcode problems as well. Have my Facebook interview on 8th. Will definitely check these DS videos of yours. :)
@eduriseworld4 жыл бұрын
BTW All, Facebook Enterprise Team is hiring like crazy at the moment. Pick a Facebook Recruiter from LinkedIn and send them a message that you want to join the "Enterprise Team", they will hook you up with the right department. Feel free to ask me if you need help. Can't help you get an interview right away, but can definitely guide the way in which you can get an interview. I don't work at Facebook (yet!)
@tomershechner4 жыл бұрын
@@eduriseworld Good luck man, let us all now when you get hired! (maybe you'll replace Zuckerberg, who knows ;D ?)
@LabaranLabs4 жыл бұрын
@@tomershechner sure
@cristlui44 жыл бұрын
Are you a mind reader? This is truly fantastic. Thank you so much Brad!
@ChaitanyaArige11 күн бұрын
nice work Brad very clear to understand
@N63B44TÜ4 жыл бұрын
Great video like always Brad! In 4:24 instead of those two lines 10 and 11 you could write : return this.count++
@rasulyakubov14614 жыл бұрын
I think a new ERA is going to begin for Traversy Media Students and for Brad too :)
@captainmeme94764 жыл бұрын
hope one day you are not going to left us , without telling even a goodbye , your are an inspiration for a lot of people who are struggling in their life , am living in a place where tech and programming stuff are impossible to learn and accecible only for extra-rich people , i had and i still have a lot of different problems in my life but with you guys (dev dd , web dev...) my vision about life has changed and am determined to do my best , hope one day we are going to meet and speak like friends . #devTips #thenewboston...........
@TheNerdyDev4 жыл бұрын
Something different. That's great, Brad. What a coincidence, I too was working on a data structure tutorial series but with Java language.
@abelotugeme96714 жыл бұрын
Just this week I started doing work on this data structure with JS but I implemented with linked lists. Pushed the code to GitHub today...
@MadhusudanBhosale4 жыл бұрын
The way you handle errors correction, I just love it. #traversymedia #bradtraversy
@cubedev48384 жыл бұрын
Please continue this kind of series
@princesiful4 жыл бұрын
Awesome!! Really happy that you started data structure series
@xaviguasch4 жыл бұрын
This is great! I always wanted Brad to tackle data structures and algorithms in JS, please continue.
@mykolarositskyi4 жыл бұрын
Thanks, Brad! Really glad to see your videos about Data Structure! Strongly waiting for the rest videos in this area!
@abdikaniahmed22944 жыл бұрын
Please continue this new playlist for data structure. And I so interest if you add slides for explaining before writing a code as usually you do. thank you so much
@roothacks68644 жыл бұрын
I am very happy sir please make a whole series of it❤❤❤
@akashnishad81284 ай бұрын
Good , but one suggestion, you should have deleted actual element from array inside pop function, because after you remove element 'empty slots' will be created inside array
@PauloSantos-yu1tn3 жыл бұрын
I think there was a problem with .pop(), the pop method is not removing the item, it is reducing the count only, but the item remains in items list, this could lead to a memory leak. I added "this.items.splice(this.count - 1, 1); " to pop method, to really remove the item.
@NaveenRawat513 жыл бұрын
Hi Brad, you are awesome. in pop method i think you need to mutate the items array also by removing the last element. thanks
@retr04774 жыл бұрын
Wow please keep releasing these Data Structures & Algorithms videos. I really appreciate it bro
@gottamsnehamary94204 жыл бұрын
Plz do make full course on data structures in JavaScript either on the channel or on Udemy ..please as a programmer it's very important stuff
@avi124 жыл бұрын
In the .pop() method you forgot to modify the items stack
@ekrempolat76044 жыл бұрын
Hi bro. Please stay home and never leave nowadays. Covid-19 and events in US makes ne nervous. I always think what would i do if something happens to you.
@novailoveyou4 жыл бұрын
I would love to see testing! Thanks for your videos Brad!
@ShubhamSauravYT4 жыл бұрын
Please continue with the series and also make some videos on Go programming language
@truphenalwanga98294 жыл бұрын
Can' t wait to see more on this series. Great start.
@MrGarfield4 жыл бұрын
Hmmmz, Correct me if 'M wrong... But pop() is not really removing the content out of this.items. it just decreasing the this.count. If you add a console.log(this.items) to the function pop(), you will always see [ 100, 200, 300 ] reset(){ this.count=this.items.length; } stack.reset(); this will return magically all items ;-)
@theartist88354 жыл бұрын
Hey Brad! Thanks for the amazingly put content. I just wanna say that you forgot to remove the last elemnt from the items array in the pop method!
@praveengautam46892 жыл бұрын
yes i am stuck in pop method can you please explain the correction in pop method
@arjunkashyap88964 жыл бұрын
I know stack and other DS but I'll still watch this series..
@magedhanafy90104 жыл бұрын
Yes, please do a video on proper testing
@skandmishra37394 жыл бұрын
Thanks for your videos. Please make a video on Binary search tree with traversing like BFS and DFS
@benomayio36662 жыл бұрын
Thanks man! I always enjoy your tutorials
@matevzmiskec53889 ай бұрын
Pop method isn't actually removing anything from the array, you are just returning the element that should be removed.
@judeokagu67574 жыл бұрын
Finally 😀 Brad to the world 🌎
@sergiyrudenko9054 жыл бұрын
Great Thanks!!! Please make full data structure course I need it.
@credonduhura71214 жыл бұрын
Thanks for starting this series Brad!! it's very important stuff to know as a programmer, as you mentionned. Can you please make a udemy course for algorithms and data structures
@BBI-Brandboost4 жыл бұрын
This is great content. We look forward to the next one in the series.
@gabrielaudette73454 жыл бұрын
You should throw a new error in the pop method instead of returning undefined so you don't have to console.log the stack every time you pop an empty stack
@MattDuarte114 жыл бұрын
Oddly enough my last user story I had to use a hash map data structure. I don’t know data structures and was able to do it with the Map object in JS. I need to learn these
@ThiagoVieira914 жыл бұрын
Just in time for a productive lunch break! 🙌🏼
@woozy_deer4 жыл бұрын
Thanks! I love these data structures videos
@JamieMcGibbon4 жыл бұрын
Great video! Thanks for taking the time to put it together! Looking forward to the others in the series!
@smartydude21574 жыл бұрын
That's so awesome 😍 i think Actually my Law of Attraction has worked out.. I was daily searching for great whole algorithm series and finally got it 😊😊😀
@srdjagunjic4 жыл бұрын
Brad. Pop seems to reduce the count but if you console log the array, you will see that it is the same?
@tenzinwoeser6842 Жыл бұрын
I am bit confused here. In the pop method you return the element to pop but you didn't really remove it from the array. Please let me know if i missed anything.. BUT HEY LOVE THIS SERIES
@romanahmed56554 жыл бұрын
Wow..... Nice series .Thank you brad.
@adityajain66304 жыл бұрын
Please add videos for Arrays, Strings, Set, Graph, Tree, Hash etc and many more data structures in JavaScript.
@andrewclarke69164 жыл бұрын
Thanks for this, Brad. Really looking forward to this series. It will probably involve you having to explain some concepts with diagrams though, which you're not so keen on doing.
@mohsin63124 жыл бұрын
Thank you Brad. Looking forward to this new series.