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 :)
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!
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
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.
Really! You are great teacher in the RU-vid 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
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!
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?
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.
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!
Honestly the fact that you still provide free stuff on YT and not just Udemy is the best. I'm already familiar with Stacks but it's nice to see your content quality is great even when it's free! Keep it up, more people like you in the world is what we need.
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.
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.
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! 💚
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..
@@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.
@@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}`);
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.
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. :)
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!)
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
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.!!
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.
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
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.
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; }
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.
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.
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!!
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.
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.
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.
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 !
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.
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...........
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..
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..
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.
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
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
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
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 😊😊😀
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.
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.
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
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 ;-)