Implement a Stack - Java Interview Coding Challenge #4 [Java Brains]

  Рет қаралды 70,741

Java Brains

Java Brains

Күн бұрын

Пікірлер: 75
@nilimadey8593
@nilimadey8593 5 жыл бұрын
SIR PLEASE KEEP MAKING THESE JAVA INTERVIEW QUESTIONS ON A REGULAR BASIS, FROM EASY TO HARDEST, PLEASE🙏🙏, AND PUT MORE MORE CONTENT ON DATA STRUCTURE IMPLEMENTATION IN JAVA
@asashish905
@asashish905 5 жыл бұрын
Earlier, I used to wait for Shaktimaan every Sunday, now, I wait for you every Sunday. :) Thank You, Sir!
@baubaudinamo
@baubaudinamo 4 жыл бұрын
I searched for Shaktimaan :))))))))))))))))))
@raghavanaliassaravananm1546
@raghavanaliassaravananm1546 5 жыл бұрын
More than anything I always fall in love with your simplicity and modesty!!
@bepa7442
@bepa7442 Жыл бұрын
This youtube course is exactly what i was looking for, it helps me a lot with learning Java. Thank you for your work.
@mohanbabu9181
@mohanbabu9181 4 жыл бұрын
He is working in LinkedIn ... still he is teaching..great sir...proud to be kannadigas
@abhijitpatwardhan8406
@abhijitpatwardhan8406 3 жыл бұрын
Love your videos! One comment about not worrying about clearing out the element when "pop()" is invoked. If this were a stack containing objects (i.e. instances of some class created on the heap unlike primitives) then unless the reference to the popped object is nulled out, the object will not be garbage collected, effectively creating a memory leak. ("Effective Java" by Joshua Bloch-- item 7 talks about this exact scenario.)
@lijalemuregeha2227
@lijalemuregeha2227 2 жыл бұрын
Very intersting, you really break down things to make an easy grasp. Thank You!!!!
@Teardropper-nm3ht
@Teardropper-nm3ht Жыл бұрын
I am getting so much out of these videos, and greatly appreciate what you've done. Something new for me is seeing functions/methods referred to as API's. I'd love it if you could talk about that a little bit. Thanks!
@GenjaOrigins
@GenjaOrigins 3 жыл бұрын
Thx professor i am trying to get a java job at a company in my hometown. All coding Challenges are important for me. Keep adding more in future please
@srinivasb1144
@srinivasb1144 5 жыл бұрын
Awesome explanation, you make it look very easy, keep making these interview questions. Thank you very much.
@abhirambandi6091
@abhirambandi6091 3 жыл бұрын
Sir, Make entire Data Structures and algorithms using Java..
@for461
@for461 2 жыл бұрын
Very Nice Explaination Sir. Thanks. Everyone can understand easily. Awesome.
@gs-rc3eq
@gs-rc3eq 5 жыл бұрын
Where can I find the code for this ? Can you also run the program and show us the output. Thank you, explanation is good
@siminam.michile4648
@siminam.michile4648 4 жыл бұрын
Thanks so much for the accuracy and patience while explaining each concept!
@raghavanaliassaravananm1546
@raghavanaliassaravananm1546 5 жыл бұрын
You are a hero Kaushik. Undoubtedly all of your videos of good quality and enlightening and educating! Keep going and my best wishes for you to spread the knowledge world wide!!
@literatebasics6305
@literatebasics6305 5 жыл бұрын
Hi Kaushik. Its useful video. I am struggling lot in implementing algorithms and data structures at my work. But now i started watching your coding challenge and its worth watching. Please make more videos in your free time for novice like us. Great job again ..... 😊
@ameeralikhan9288
@ameeralikhan9288 5 жыл бұрын
I love watching your video simply because you explaining everything in simple words you see most people will use these jargon to show off basically but thing is who has the core knowledge will explain something in most simple words giving simplest of the examples. Second, please make a video on trees i always had tough time remembering it.
@ILuvBilli
@ILuvBilli 5 жыл бұрын
Wow, u made a tough coding like a child's play
@seethalakshmiadiga2477
@seethalakshmiadiga2477 4 жыл бұрын
Please upload more interview coding challenges..Ur way of explaining amazing
@MousumiDas-pz6zu
@MousumiDas-pz6zu 5 жыл бұрын
awesome.. can you show other data structures implementation as well like hashmap
@toufiqurrahman7025
@toufiqurrahman7025 5 жыл бұрын
please continue this series
@RishabhDeepSingh
@RishabhDeepSingh 5 жыл бұрын
Won't it be good if we use LinkedList as when we initialize a stack we don't know how many elements we are going to have?
@Java.Brains
@Java.Brains 5 жыл бұрын
I prefer arrays because it's the best combination of performance and space efficiency. But yes, you can remove upper-bound limits in both arrays and linked-list approaches
@mkvjaipur
@mkvjaipur 3 жыл бұрын
You are a Genius
@davidoparanti
@davidoparanti 4 жыл бұрын
Thank you very much Sir for your selfless efforts in imparting knowledge to others. How are you sir? Please do more of this.
@MatheusSilva-gx8sj
@MatheusSilva-gx8sj 3 жыл бұрын
Thank you! Awesome work! Greeting from Brazil!
@SushilKumarBhaskar
@SushilKumarBhaskar 5 жыл бұрын
Excellent Explanation EE+ , (Mr_kaushik.equals(ValueOf(Invincible_Teacher)) == Unbeatable) ? True : True
@alxx736
@alxx736 3 жыл бұрын
Is ok using List instead Arrays ? What is the difference ?
@vasanthasetty4002
@vasanthasetty4002 4 жыл бұрын
Einstein of Java👍
@neha.batham
@neha.batham 5 жыл бұрын
Well explained, please upload more such videos on ds.
@Krishna42570
@Krishna42570 5 жыл бұрын
Superr explanationss...if we doo like the programming questions which were asked in different company drives you will get 10milliin subscribers
@Java.Brains
@Java.Brains 5 жыл бұрын
Thanks! I’m honestly not into the whole subscribers thing. If folks find it useful, that’s a good enough reason! Will try to make more of these
@explorerfl007
@explorerfl007 5 жыл бұрын
@@Java.Brains Great work.
@addy0507
@addy0507 5 жыл бұрын
Excellent explanation, thank you.
@abhishekbhattarai4191
@abhishekbhattarai4191 4 жыл бұрын
thankyou so much for such a nice explanation!
@phanindraitika5609
@phanindraitika5609 5 жыл бұрын
Good one Kaushik 👍👍 !! Appreciate your effort to educate us!!!
@kalyanalladi
@kalyanalladi 5 жыл бұрын
Your videos are nice and clear.
@techbarikcom
@techbarikcom 4 жыл бұрын
Really love this video. Thanks
@siddhantpatil8075
@siddhantpatil8075 4 жыл бұрын
Hi how to map request response correctly in multiple clients (multithread) if system is asynchronous.
@orenazuz
@orenazuz 5 жыл бұрын
Hi I'm sorry to interrupt but if you won't remove the item from the array and jest move the pointer the gc will not remove it for you because it doesn't know that there is no reference to this item so it will stay there forever and you can end up with instances explosion maybe for this example it's ok but generally it's not a good practise implementing stack without cleaning objects. all the best keep on the good job
@prem9394
@prem9394 5 жыл бұрын
@javabrains thanks for this amazing series!
@manikantaboggarapu5521
@manikantaboggarapu5521 5 жыл бұрын
Awesome explanation.. Just only one query related to Stack class hierarchy in Java. Collection API.. What made the developers to extend the Vector (which is random Access)? This was the question I got asked to.. :(
@dinarafi6799
@dinarafi6799 5 жыл бұрын
Thread safe
@barslo
@barslo 5 жыл бұрын
I think you should use node insted of array. What you did doesn't test anything.
@Java.Brains
@Java.Brains 5 жыл бұрын
I prefer arrays because it's the best combination of performance and space efficiency. But yes, you can remove upper-bound limits in both arrays and linked-list approaches
@aseemshrestha3354
@aseemshrestha3354 5 жыл бұрын
As always good explanation.. but rather than throwing exception, auto resize when stack is full would have been better
@explorerfl007
@explorerfl007 5 жыл бұрын
Arrays cannot be resized after initialized. ArrayList can do that
@_djavs
@_djavs 5 жыл бұрын
Keep these coming!
@sunilyadav-xt7op
@sunilyadav-xt7op 5 жыл бұрын
Nice explanation.... U ok¿? Seems feeling tired.... Hope all okkkk
@prabhatgupta1134
@prabhatgupta1134 3 жыл бұрын
STACK can be very easily implemented using LinkedList. Push() will keep calling addFirst() of the underlying LinkedList data structure. Pop() can be implemented by calling removeFirst() of LinkedList. Let me know your thoughts.
@saddamahmad2310
@saddamahmad2310 5 жыл бұрын
thank you very much sir for this video
@polam511
@polam511 5 жыл бұрын
How to find battleship in the 2x2 matrix
@subramanichockalingam5637
@subramanichockalingam5637 5 жыл бұрын
Love this series ❤ Thanks Koushik
@mohammadosama4709
@mohammadosama4709 5 жыл бұрын
Is this series still progressing ?
@sanjaynatarajan4906
@sanjaynatarajan4906 4 жыл бұрын
Thank a lot man!!
@vinceclarktanola8668
@vinceclarktanola8668 4 жыл бұрын
Linkedlist and queues please
@gandharvasai7440
@gandharvasai7440 3 жыл бұрын
make the videos on coding more
@AkiZukiLenn
@AkiZukiLenn 4 жыл бұрын
LOL wtf my school need me to learn compose and inherit from linklist too , jess .
@PretheshP
@PretheshP 3 жыл бұрын
Thx
@cschipg4688
@cschipg4688 2 жыл бұрын
TYSM!
@Павел-у7ф2е
@Павел-у7ф2е Жыл бұрын
I think it's easier) static class Stack{ public Stack stack; public Node node; private static class Node{ public Node next; public S val; } public void put(T val){ Node temp = node; node = new Node(); node.val = val; node.next = temp; } public T get(){ T val = node.val; node = node.next; return val; } } @Test void stackTest(){ Stack stack = new Stack(); stack.put(1); stack.put(2); stack.put(3); System.out.println(stack.get()); System.out.println(stack.get()); System.out.println(stack.get()); }
@codecreww
@codecreww 3 жыл бұрын
why top is -1 please explain ?
@apparte462
@apparte462 3 жыл бұрын
03:05 when you say array you seem sus hahahaha
@romia1753
@romia1753 3 жыл бұрын
What's an API?
@TheMumbai31
@TheMumbai31 5 жыл бұрын
Very good explanation 👍
@Java.Brains
@Java.Brains 5 жыл бұрын
Thanks! :)
@chrisnolan8263
@chrisnolan8263 5 жыл бұрын
How do you know the video was good? It was uploaded at the same time you commented. You don't have to kiss the channel guy ass for compliments. Stop whoring around for insignificant KZbin likes/heart
@Java.Brains
@Java.Brains 5 жыл бұрын
That’s a bit harsh. Although I agree that the point is for people to get value out of the content, not likes. Anyway, here’s a heart on your comment to show that no “whoring” necessary for any (albeit insignificant) KZbin points. :)
@truth656
@truth656 5 жыл бұрын
Queue Implementation in java using Array want more patterns ask me: class QueueImplementationUsingArray { int head=0; int tail=0; int insert=0; int dequeuedValue=0; int arr[] = new int[4]; void enqueue(int data) { if(insert>=0 && insert
@chiranjeevisaride
@chiranjeevisaride 5 жыл бұрын
Dude no one asks these type of Algorithm or DS questions in Technical interviews please pick a question from Leetcode.com, geekforgeeks.com, careercup.com
@blasttrash
@blasttrash 5 жыл бұрын
so true lol
@John-Is-My-Name
@John-Is-My-Name 7 ай бұрын
Is there a reason you did not use an List/Arraylist? my solution was this: public class MyStack { private static ArrayList myStack; public MyStack() { myStack = new ArrayList(); } public static void put(Object object) { myStack.add(object); } public static Object pull() { if (myStack.isEmpty()) { return null; } Object lastElement = myStack.getLast(); myStack.removeLast(); return lastElement; } public static Object peek() { if (myStack.isEmpty()) { return null; } return myStack.getLast(); } }
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 12 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 54 МЛН
How to add Swagger to Spring Boot - Brain Bytes
21:09
Java Brains
Рет қаралды 457 М.
What is JWT? JSON Web Tokens Explained (Java Brains)
14:53
Java Brains
Рет қаралды 1 МЛН
Detect Capital - LeetCode Interview Coding Challenge [Java Brains]
25:09
Java Interview Coding Challenge #2: Two Sum [Java Brains]
15:07
Java Brains
Рет қаралды 162 М.
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 12 МЛН