Home TechnologyProgrammingSQL & Databases Subscribe to RSS

Can You Explain About STACK In Data Structures?

Please explain me about stack , its use , functions as much as you know . I'm a b.tech student . I'm feel difficult to understand about it in class room ..so please explain me about it in a simle manner.

Answer Question

2 Answers - Sort by: Date | Rating

    A stack is used to implement LIFO (last in, first out) storage of data.  The act of storing things on the stack is commonly known as "pushing" and the act of removing things from the stack is know as "popping". An example how a stack would work when storing some numbers:
    Push 4
    Push 7
    Push 5
    Push 9

    First pop operation return 9
    Second pop returns 5
    Third pop returns 7
    Fourth pop returns 4

    Any additional pop request will result in an error.  Notice that the elements were returned in the opposite order that they were stored in.
    0 0

    Boris  

    answered 2 years ago

      In data structure stack mean a bundle. E.g. A stacks of data in a table, A stack of books, A stack of CDs.
      0 2

      Masroor  

      answered 3 years ago

        More

           
           

          Ask a Question via Twitter

          Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

          Blurtit Store

          Get T-shirts, hoodies, caps and more at the Blurtit store

          Blurtit International