Data structures: Array implementation of stacks

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 300

  • @iftekharjitu4161
    @iftekharjitu4161 3 роки тому +135

    The tutorial is from 2013, and I am from 2021, seems like it will never get old. God bless you

  • @emmojo3428
    @emmojo3428 10 років тому +447

    As a hearing impaired beginning programmer, I want to thank you sincerely for the captions. You have just earned a subscription from me, which is unique given that I don't have any other subscriptions. Keep up the great work.

    • @mycodeschool
      @mycodeschool  10 років тому +77

      Jamaika I am very glad that you are getting helped. :)

    • @gamereplayhq
      @gamereplayhq 9 років тому +29

      +Jamaika (y) THIS COMMENT MADE MY DAY :D

    • @SonuSonu-tk5pk
      @SonuSonu-tk5pk 7 років тому +1

      why ? doesn't c taught in ur country?

    • @priyavratkumar4296
      @priyavratkumar4296 7 років тому +11

      Sonu Sonu sabse yahin puchega?

    • @ashishagrawal1406
      @ashishagrawal1406 7 років тому +21

      1. Check your English Before Commenting.
      2. One can watch UA-cam videos irrespective of the fact that the thing is being taught in their country.
      3. Stop spamming UA-cam with foolish comments.

  • @Danieljohnson-sh7iq
    @Danieljohnson-sh7iq 6 років тому +53

    OMG whoever did and organize this tutorial God will bless him. I have went through 13 executive tutorials on stack i still didn't get it, but once i watch this video, it's as if the tutor transfered the knowledge to my brain straight LOL. Once again thank you, am subscribing.

  • @MatheusLB2009
    @MatheusLB2009 7 років тому +37

    Your video makes the internet a better place

    • @israa6280
      @israa6280 6 років тому +1

      Matheus Lacerda so agreed

  • @kevinrocky4443
    @kevinrocky4443 4 роки тому +81

    Anyone else feel like you learned more from this than in college?

  • @vladalbescu4153
    @vladalbescu4153 9 років тому +188

    Array Stack of Winterfell.

  • @sarojhkalyan1527
    @sarojhkalyan1527 2 роки тому +1

    Thank you for making this video. Explanations from others didn't get me to understand this concept as thoroughly as yours did.

  • @Calm_Energy
    @Calm_Energy 6 років тому +1

    I really appreciate how you give me the words to describe the connection between the pseudo-code and Big O notation. For ex. "two scenarios in a push operation," then you show the details between constant time for a normal push operation then O(n) for an overflow correction using a larger array. Next you say "the time complexity of push with this strategy" O(1) in best case, O(n) in worst. Plus the pseudo-code really helps!

  • @zlcoolboy
    @zlcoolboy Місяць тому

    This makes stacks so easy to understand. No wonder people like them so much. So useful, especially if you make a struct out of it.

  • @amitech1992
    @amitech1992 11 років тому +1

    Great tutorial and nice accent, easily understandable. U reduced my work to Google a lot and then go through too many pages to understand these concepts for my College viva.

  • @virenbhanushali9282
    @virenbhanushali9282 7 років тому

    The clearity of your words just blew my mind.keep you work on

  • @MubasharAli-op5vq
    @MubasharAli-op5vq Рік тому +1

    The tutorial is from 2013, and I am from 2023, seems like it will never get old. God bless you

  • @RenuSharma-zb2bz
    @RenuSharma-zb2bz 4 роки тому +1

    One good thing is that while explaining the data structures not any particular language is used so it is easy for any language study to watch this video

  • @daveboyle76
    @daveboyle76 4 роки тому

    You're explanation is clear and concise. Far superior to the text provided with our course. Thank you.

    • @MicroNG
      @MicroNG 3 роки тому

      please check the details

  • @smitasharma2979
    @smitasharma2979 8 років тому

    I have gone through all your data-structures videos and I really like the way you explain. I appreciate the content as well as the clarity of the voice and flow.

  • @PurnenduMondal_
    @PurnenduMondal_ 6 років тому +2

    Sir You bring my Confidence Back.....Thank you a Lot...for all of your Videos

  • @fay_chong
    @fay_chong 8 років тому +1

    Hi, I consider myself rather green when it comes to programming and I have legit no idea what my professor has been teaching until I found this video. Thank you so much for your clear explanation. :) This video is super helpful!

  • @aricktanwar7436
    @aricktanwar7436 6 років тому

    One of the talented person who knows data structures as mother tongue
    he will be the only reason i pass my examination

  • @PokeDubzTCG
    @PokeDubzTCG 8 років тому +4

    Your videos are great! Thanks for the clear explanations, as my current CSC-250 professor doesn't give us much information on these forms of data structures.

  • @usmanabdurrahman2461
    @usmanabdurrahman2461 8 років тому +18

    Tommorow's my final.Bless you 😂😂

  • @samarth-yt-gn
    @samarth-yt-gn 6 років тому +1

    I really don't understand why few disliked, this made me understand concepts of stack well.

  • @yilingl.8756
    @yilingl.8756 10 років тому +6

    This helps so so so much!! Thank you for the clear explanation.

  • @mycodeschool
    @mycodeschool  11 років тому +19

    We wish that too :)

    • @VinayKumar-vm1hg
      @VinayKumar-vm1hg 4 роки тому +2

      Sir how top=max_size-1

    • @jeetsharma9892
      @jeetsharma9892 4 роки тому

      @@VinayKumar-vm1hg If you understood please explain it to me as well.

    • @AmanSharma-ht5zq
      @AmanSharma-ht5zq 4 роки тому +2

      @@VinayKumar-vm1hg In most programming languages, the arrays are implemented as 0 based index. Let's say there are 2 elements in an array, so its max_size = 2, and there are only two indices - 0, 1. So the variable top should be equal to 1, hence top = max_size-1;

  • @tusharjajodia9077
    @tusharjajodia9077 3 роки тому

    Still the Best Tutorial in the platform

  • @PC-ky3qo
    @PC-ky3qo 7 років тому

    This is the best explanation i could ever get on array implementation of stack. thank you very much

  • @rownitakhanam5013
    @rownitakhanam5013 5 років тому +1

    This video is very helpful.I was going hardtime for perceiving the concepts.And I got poor marks.Now I have started to understand by Mercy of Allah.Thanks a lot for this video.

    • @075_ritikkumar7
      @075_ritikkumar7 4 роки тому +2

      Har cheej me allah ko ghusa do. Thank to this great tutor , not allah.

    • @rownitakhanam5013
      @rownitakhanam5013 4 роки тому +1

      @@075_ritikkumar7 It is always Allah (The One and Only God) who always helps me for everything. He is the Rahman( The beneficent)has created us from mingled sperm. I also thanked this tutor who has helped me. But if I loose my brain power ,then this tutor can help me no more despite his talent. Because I was depressed for many years. Even I was going to attempt suicide .At that time, it was hard for me to study and understand hard concepts. Fortunately, Allah guided me through HIs Scripture 'The Quran' and helped me to overcome my depression. Finally, I have found a new meaning of my life.

    • @rownitakhanam5013
      @rownitakhanam5013 4 роки тому +1

      @@075_ritikkumar7 Allah is the most wise.He created everything with exact meaaure through His knowledge He has knowledge about both seen and unseen.

    • @rownitakhanam5013
      @rownitakhanam5013 4 роки тому

      @@075_ritikkumar7 Try to respect every religion. And before commenting also read scripture of respective religion

  • @CSEconceptswithParinita
    @CSEconceptswithParinita 5 років тому +2

    Thank you so much sir! You're an inspiration for new tutors like me🙏

  • @semirumutkurt6635
    @semirumutkurt6635 7 років тому

    give this man a medal

  • @zannylover2898
    @zannylover2898 5 років тому

    No word for this kind of knowledge,simply fr m the best in the world ,where are u sir plz comeback we want more videos from you,plzzz sir help u truly the best in the world.

  • @TheGreenRedYellow
    @TheGreenRedYellow 9 років тому +7

    Your top function has a bug. It will crash if we have an empty stack. At 11:25.

    • @hamadaesmael2176
      @hamadaesmael2176 5 років тому

      add if condition to check if it is empty

    • @jerushanmoodley2641
      @jerushanmoodley2641 5 років тому

      #include
      #include
      #define max_size 101
      int a[max_size];
      int top=-1;
      void isempty()
      {
      if(top == -1)
      {
      printf("error: stack is empty ");
      return;
      }
      }
      void push(int x)
      {
      if(top == max_size -1) // handles stack overflow
      {
      printf("error: stack overflow
      ");
      return;
      }
      top++;
      a[top] = x;
      }
      void pop()
      {
      if(top == -1)
      {
      printf("error: no element to pop
      ");
      return;
      }
      top--;
      }
      int Top()
      {
      isempty();
      return a[top];
      }
      void print()
      {
      isempty();
      int i;
      printf("stack: ");
      for(i=0;i

  • @bihator
    @bihator 9 років тому +5

    You are absolutely amazing man !!

  • @nehahanwate7322
    @nehahanwate7322 5 років тому +3

    thanks for this good explanation and clearing the concept

  • @chenghuapang7504
    @chenghuapang7504 7 років тому

    so easy! you did a better job than my professor...

  • @himanshusattavan1335
    @himanshusattavan1335 7 років тому

    My code school,
    just simply rocks........

  • @douglasdavisv
    @douglasdavisv 8 років тому +1

    i can feel the dedication from your each word.thank you for the information.i killed the subscribe button .#feeling informative with my code school

  • @babruwankshirsagar6390
    @babruwankshirsagar6390 9 років тому

    keep doing it. it is really work as helping hand for many of us..thank you.

  • @noaido9803
    @noaido9803 5 років тому

    All the lessons are great!
    Thank you!

    • @MicroNG
      @MicroNG 3 роки тому

      please check the details

  • @sreekeshv12
    @sreekeshv12 8 років тому

    thanks bro I understood the topic very well you earned yourself a subscriber

  • @welkin102
    @welkin102 11 років тому +3

    i really wish that you guys had started this video-makings a year before !!

  • @everfresh9693
    @everfresh9693 8 років тому +1

    Nice video dude!! It helped alot, keep up the great work

  • @RajendraSingh-kv7df
    @RajendraSingh-kv7df 6 років тому

    Sir this is very very clearly and amazingly explained video
    Thank u very much

  • @royal9063
    @royal9063 4 роки тому

    My wish is to free and quality education for all. I don't know how many of you are doing this work. But I wish to God to give a healthy and prosperous life to all of you. Bcoz you r doing a great work. Plz make more videos. You know about India's privet college. they are just useless. You have a great quality to teach everything in simple way. Plz help me help us to become a Good engineer from privets college. We want more videos. Plz make more videos.

    • @MicroNG
      @MicroNG 3 роки тому

      please check the details

  • @dodgywarden8788
    @dodgywarden8788 6 років тому

    Thankyou so much. Now i can Write Stack code on my own

  • @melissahong1
    @melissahong1 7 років тому +45

    4:10 - "We do not care what garbage lies there" Hahaha

    • @user-mc1eb1sg5x
      @user-mc1eb1sg5x 6 років тому +5

      mean bully
      I think you are the one with the garbage face and you're trying to feel good by posting sh*t in the internet.
      Get a life man.

    • @FatmaYousuf
      @FatmaYousuf 6 років тому

      Grove Street calm your balls

    • @shubhangisoni1668
      @shubhangisoni1668 6 років тому +9

      By garbage ,he meant garbage value , that is a typical word in programming vocabulary ,used to describe unwanted value /data .

    • @ujjwalb7406
      @ujjwalb7406 5 років тому +1

      Garbage value is a thing!!

    • @dancinglikecrazy5510
      @dancinglikecrazy5510 4 роки тому

      @@user-mc1eb1sg5x wtf💀💀💀🤣🤣🤣 you okay my guy?

  • @chetanyat4632
    @chetanyat4632 9 років тому +3

    u r d best in dis business :) thankyou soo much for such beautiful and easy to understand explanations :D
    #appreciate#your#work :)

  • @ramakrishnan4356
    @ramakrishnan4356 7 років тому

    u saved me from my exam thx a lot bro

  • @sowjanyayellumahanti8460
    @sowjanyayellumahanti8460 8 років тому

    this explanation helped me a lot sir. thank you very much

  • @tuankietdang7285
    @tuankietdang7285 7 років тому

    Just what I need, thank you for your informative video

  • @sarweswaranss5526
    @sarweswaranss5526 4 роки тому

    Perfect teaching..Finally i learnt tq u so much..

    • @MicroNG
      @MicroNG 3 роки тому

      please check the details

  • @carefree_ladka
    @carefree_ladka 5 років тому

    Really loved your lectures bro 😊 .. helpful

  • @007MrAjay
    @007MrAjay 7 років тому +2

    For n pushes, cost of copy should be 1 + 2 + 4+....+ (n/4) + (n/2), because when the stack is overflowed on trying to push the ((n/2) + 1)th element, it creates another dynamic array of size n, which can contain all n pushes. So, why did we include 'n' in the cost?

    • @yashgirdhar100
      @yashgirdhar100 6 років тому

      so for n+1 elements, you''ll have to include n

  • @abdelmajidkansoussi6904
    @abdelmajidkansoussi6904 2 роки тому

    thank you man , this was very helpful. God bless you.

  • @ys2313
    @ys2313 6 років тому +1

    Thanks Sir. it helped me a lot.

  • @skywolf6984
    @skywolf6984 10 років тому +2

    Your videos amazing man , thanks for sharing them they help a lot. Keep up good work =)

  • @vyshuvysh2502
    @vyshuvysh2502 6 років тому

    explanation is done very well... thanks

  • @rudreshjha7166
    @rudreshjha7166 Рік тому

    Nice explanation man

  • @qR7pK9sJ2t
    @qR7pK9sJ2t 5 років тому +1

    This is a Indian youtuber ... So finally we can say that WE INDIA WE WIN...

    • @lastday1543
      @lastday1543 5 років тому

      RIP HUMBLEFOOL...😢😢🙏

  • @str89z
    @str89z 4 роки тому +1

    2:10 for empty array, index is -1...bc of imaginary array

  • @adityabokkisum1000
    @adityabokkisum1000 5 років тому

    really u saved my day man a big thank for u

  • @johncena-fx2ur
    @johncena-fx2ur 4 роки тому

    The top function will return the element at the top of the stack. So in push function top==MAX-1 might be true even if stack is not full

    • @MicroNG
      @MicroNG 3 роки тому

      please check the details

  • @syedfilms4447
    @syedfilms4447 4 роки тому

    amazing woaww i learn first time from your this tutorial and understand stack with array too much easily thansk sir

    • @MicroNG
      @MicroNG 3 роки тому +1

      please check the details

  • @maaz6912
    @maaz6912 6 років тому

    In the top function, where the line " return A[top]; " is there, the compiler throws out an error that "array subscript is not an integer". And yes, my function starts with int, not void.

  • @NaveenKumarErroju
    @NaveenKumarErroju 8 років тому

    fabulous explanation...

  • @mohitbv2331
    @mohitbv2331 8 років тому +1

    Thank you. God bless you. Keep it up.

  • @usama57926
    @usama57926 6 років тому +1

    thank u for mathematical explanation

  • @theglitchmindset2256
    @theglitchmindset2256 4 роки тому

    here is an exercise print the stack LIFO(last in first out) style to make it a real stack.

  • @Sun-yv9fr
    @Sun-yv9fr 5 років тому

    I've been watching EVERY video about to understand the pop( ) concept, and NOW I'm finally understanding what happens to the number after the pop( ).

  • @thapelomokgwaphe3005
    @thapelomokgwaphe3005 10 років тому

    thank you very much,wish u wer my lecturer

  • @techpro8565
    @techpro8565 5 років тому +1

    Making continuous command line type input for continuous push and pop operations in a stack in cpp.
    Enter operation push, pop or exit and press enter, then enter the number for push operation
    to exit enter command exit
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    #include
    #include
    using namespace std;
    #define max_size 6
    int top, arr[max_size];
    void display()
    {
    cout

  • @DMSAProductions
    @DMSAProductions 10 років тому

    Thank you very much! I have been trying all over again to creat something similar without any success!!! THANK YOU!!!! You helped me a lot!

  • @muhammadhamzashahid9649
    @muhammadhamzashahid9649 3 роки тому

    int countChar(char*, char);
    int main() {
    char string[50];
    char letter;
    cout

  • @shivangisrivastava1158
    @shivangisrivastava1158 4 роки тому

    love your voice man 💯

  • @TheJust4give
    @TheJust4give 9 років тому

    I am becoming a big time fan of your lessons. Do you have any lesson on AVL ? I was not able to find one from your list.

  • @mounica.b5344
    @mounica.b5344 11 років тому +1

    awesome tutorial ,pls keep more videos on trees and graphs in c++(oop) language

  • @nandangupta727
    @nandangupta727 9 років тому

    awesome tutorial of DS .. thnku so much.. :)

  • @AspirantNoteBooks
    @AspirantNoteBooks 8 років тому +6

    but i want to see implementation using java too

  • @dev69ff
    @dev69ff 5 місяців тому +1

    Legends watching in 2024😂😂

  • @josiahsamson6022
    @josiahsamson6022 8 років тому +4

    Very understandable,,,,,,,,,,,

  • @elie3423
    @elie3423 6 років тому

    in case of IsEmpty() method, just return top == -1 without if and else statements

  • @DASARITUTS
    @DASARITUTS 9 років тому

    thanks good explanation,sir which microphone do you use for recording.

  • @rapramos5687
    @rapramos5687 7 років тому +1

    I think you forgot to include in the description the other array based implementation of stack in C. you only included the github link to the source code you wrote in the video.

  • @HabiburRahman-xs9gb
    @HabiburRahman-xs9gb 7 років тому

    simple and clear...just awssm

  • @AnishMahapatra01
    @AnishMahapatra01 7 років тому

    You are God @mycodeschool. One more thing I wanted to ask from about 9:30, do you guys also hear weird breathing in the sound of the video?

  • @vaibhavlodha5398
    @vaibhavlodha5398 7 років тому

    Shouldn't the best case and average case be represented using Omega and theta rather than Big O notation? (time - 8:01)

  • @morrisombiro
    @morrisombiro 6 років тому

    IsEmpty()
    {
    return top==-1;
    } // is much cleaner...Awesome videos nonetheless.

  • @jagadeeshr91
    @jagadeeshr91 5 років тому

    Good explanation

  • @ketkipatil8309
    @ketkipatil8309 4 роки тому +1

    Why the larger array is take only the double of the smaller array?Why not 3 or 4 times ?

    • @DolaLado
      @DolaLado 4 роки тому +1

      There is no certain reason for that. You can make larger array three or four times.

    • @MicroNG
      @MicroNG 3 роки тому

      please check the details

  • @cagrkaymak3063
    @cagrkaymak3063 10 років тому

    really nice job, u helped me a lot

  • @ivanreii
    @ivanreii 10 років тому

    just a question, how exactly do you create a new array when an array is full? we can't create a new node like what we did in linked list since these arrays are located in stack part of the memory, where linked list is in the heap, correct?
    I mean, we can't write
    if(top == max_size)-1{
    int B[max_size*2]; or new B[max_size*2];
    }
    even if it's possible, when B is maxed out, there will be no int C[max_size*3].
    any enlightment?

  • @王柯罗
    @王柯罗 11 років тому +2

    very good, thanks

  • @gurdyalsingh8228
    @gurdyalsingh8228 8 років тому

    for(i=0; i

  • @srinaath9845
    @srinaath9845 7 років тому

    thank u so much..i am very grateful to you

  • @rztutul8824
    @rztutul8824 7 років тому

    Thanks ...excellent video ..

  • @KistlakRajapakshaSevenNet
    @KistlakRajapakshaSevenNet 8 років тому +3

    Thank U Very Much Bro !! :D

  • @jayp1638
    @jayp1638 11 років тому +2

    Amazing video Buddy :)

  • @AspirantNoteBooks
    @AspirantNoteBooks 8 років тому +13

    Earned a subscription from me TOO :)

  • @XieQiu
    @XieQiu 8 років тому

    very clear. thank you!

  • @wayoflife3098
    @wayoflife3098 6 років тому

    Thank you sir 😊

  • @patrikhyll4301
    @patrikhyll4301 8 років тому

    thank you a lot!!! a great series!

  • @abhiGunasekar
    @abhiGunasekar 4 роки тому +2

    Hi MyCodeSchool Instructor. I am having some trouble in my code. I don't know why but I'm getting a stack overflow error when I try compiling this code. Would you be able to compile it on your end and let me know what might be the issue. My source code is exactly the same as yours.
    // Stack -- Array based implementation
    #include
    #define MAX_SIZE 5
    int A[MAX_SIZE];
    int top = -1;
    void Push(int x) {
    if (top = MAX_SIZE - 1) {
    printf("Error: stack overflow
    ");
    return;
    }
    A[++top] = x;
    }
    void Pop() {
    if (top == -1) {
    printf("Error: No element to pop
    ");
    return;
    }
    top--;
    }
    int Top() {
    return A[top];
    }
    void Print() {
    int i;
    printf("Stack: ");
    for (i = 0; i

    • @abhiii1375
      @abhiii1375 4 роки тому

      I think you might have figured it out by now but in your push function inside the if condition, you have used assignment operator(=) instead of relational operator(==).