import java.util.Stack; public class Main{ public static void main(String[] args) { // ******************************************************* // stack = LIFO data structure. Last-In First-Out // stores objects into a sort of "vertical tower" // push() to add objects to the top // pop() to remove objects from the top // uses of stacks? // 1. undo/redo features in text editors // 2. moving back/forward through browser history // 3. backtracking algorithms (maze, file directories) // 4. calling functions (call stack) // ******************************************************* Stack stack = new Stack(); //System.out.println(stack.empty()); stack.push("Minecraft"); stack.push("Skyrim"); stack.push("DOOM"); stack.push("Borderlands"); stack.push("FFVII"); //String myFavGame = stack.pop(); //System.out.println(stack.peek()); //System.out.println(stack.search("Fallout76")); System.out.println(stack); } }
Your 100 videos for Java/the 12 hours course for Java helped me a lot! I have Algorithms and Data Structures this semester and we are working with Java, so I hope that these videos will be helpful as well.
Can you do a playlist on how to teach difficult concepts? I have watched 2 of your playlists and you do a far better job of explaining and teaching than most professors I have had. I'm thinking being able to explain concepts in easy to understand concepts is a very important skill. Once someone has the knowledge and understanding of a topic, it is difficult for them to go back and teach the basics, but you do a great job of breaking everything down to a beginner level. I would love to be able to explain things in such a clear, concise and interesting way.
I have a honest reply from India, I am a student learning data-struchture and algorithm from India. Here I have watched to implement the merge sort And quick sort for some days. But watching your video of 10 minutes lead to clear understanding of concepts thank you for your effort, keep it up👍.
Can't get enough of that Skyrim spiel, came out of left field. Your DSA playlist was a big help during my application attempts last year. Haven't had much luck, but I'm trying again and going through all the vids.
Learning data structures in C and then coming across a tutorial in other languages often feels like cheating. Mystack = new Stack Is a wild thing to see. Very convenient however.
9:25 Here is my random comment: import java.util.Random; public class Main{ public static void main(String[] args) { Random comment = new Random(); // (...) and I don't know what to write here, but the important thing is that this is a random comment, I think (anyway, I'm accepting suggestions to complete the code).
to learn coding and land ur firstr job ever u just need: 1. CS50's introduction to computer science 2.Codecademy 3.Programiz 4.Bro Code 5. Web Dev Simplified
Sir... Pls help... is it possible to add arrays If we use import java.util.stack? I dnt know how to place it in my source code 😭😭😭.... I'm looking for ur reply asap... Really neeedddd it soo much 😭😭😭
My professor is treating stacks like an array. She has us resetting top every single time with push something onto the stack. Is this wrong or just annoying?
all in all, stack is last-in first-out. Push function is to add elements, pop function is to take elements from top and throw them anyway, peek function is to take elements from top but not erase elements in stack.
done undo redo features in text editors moving back/forward through browser history backtracking algorithms (maze, file directories) calling functions (call stack) methods push pop peek search LIFO
Hey Broo, long time! Just returned here to see that this channel has literally blown up! You deserve it, with videos like these, I'm just waiting for a million :D
I suggest you do BFS and DFS algorithms because most people find it difficult to mess with, in my perspective, I know it's kinda related to recursion but this is on a whole next level . . . with hamilton or Dijkstra as well, thank you and have a good day