Introduction to Data Structures for Interviews Stack: Q&A
Transcript from the "Stack: Q&A" Lesson
>> Bianca Gandolfo: When you guys were implementing this on your own, what were some pieces that were confusing?
>> Speaker 2: Just how the data was being stored, basically? So it made sense just to implement with an array.
>> Bianca Gandolfo: Yeah, yeah, yeah, yeah.
>> Speaker 2: And I was like, well, it already works like a stack, [LAUGH].
[00:00:23] So as an object, it was the challenge, the subject.
>> Bianca Gandolfo: Cool,
>> Bianca Gandolfo: Anything else, any questions, comments? Things that you feel like you need to pay attention to when you implement this on your own, that might be confusing later, no?
>> Speaker 3: Maybe a weird side questions, line 6, line 7, right?
>> Bianca Gandolfo: It's complicated, I mean, the answer is yes.
[00:01:14] There are a lot of ways you can go about doing it, usually they're a lot of work. So you can use things like closures, and then you can also freeze objects and stuff like that, so you can't actually change them. But in general, it's okay just to do the underscore, and people will understand that that is not to be messed with.
[00:01:40] Yeah, especially if you're using a class constructor in this way, you're not gonna be able to make it private.
>> Bianca Gandolfo: Good question.