Chaitu Tech Bits

what is difference between array and stack? what is array what is stack

Wednesday, December 15, 2010



            Briefly, there are two main differences between an array and a stack.
            1)An array can be multi-dimensional, while a stack is strictly one-dimensional.
            2)An array allows direct access to any of its elements, whereas with a stack, only  

the 'top' element is directly accessible; to access other elements of a stack, you      
must go through them in order, until you get to the one you want.
           
            Another difference is
            3)Array size is fixed where as stack can grow.

Share/Bookmark

Related Posts Plugin for WordPress, Blogger...