About 30,600 results
Open links in new tab
  1. Stack and dynamic array implementation in Java

    Nov 4, 2014 · I need to implement a stack array using a dynamic array which I had to create myself. Here's my dynamic array: import java.util.Arrays; public class Array { public int[] …

  2. Dynamic Stack Implementation Using Array in Java - Java Guides

    A dynamic stack implementation using an array in Java allows the stack to grow and shrink as needed, overcoming the limitations of a fixed-size array. By implementing resizing logic in the …

  3. How can I implement a Dynamic Array Stack in Java?

    public DynamicArrayStack( int increment ) { this.increment = increment; elems = (E[]) new Object[ increment ]; top = 0; /** . * Constructor with no parameter that will initialize. * the stack to have …

  4. Implement Stack using Array - GeeksforGeeks

    Mar 21, 2025 · In this implementation, we use a dynamic sized array like vector in C++, ArrayList in Java, List in Python and Array in JavaScript. This is a simpler implementation but less …

  5. Design a dynamic stack using arrays that supports getMin () in …

    Aug 27, 2021 · Design a special dynamic Stack using an array that supports all the stack operations such as push(), pop(), peek(), isEmpty(), and getMin() operations in constant Time …

  6. Dynamic Array in Java - GeeksforGeeks

    Nov 13, 2024 · Below are the Steps to create dynamic array in Java: Create a Array with some size n which will be the default size of array. True: then create another array with double size. …

  7. How can I make a dynamic array in Java? - Stack Overflow

    Jun 10, 2014 · Using some kind of List is a better choice, as it basically does what you want (can grow and shrink), in fact, ArrayList is just that, a dynamic array. You can hand roll your own if …

  8. Java dynamic stack implementation - W3schools

    Dynamic Stack. As we discussed in previous example that a stack throws an exception if enough space is not available to accept an entity to be pushed. To overcome this situation we can …

  9. Dynamic Array Stack Implementation using JAVA Example

    stackArray[++top] = data; } //Reading Top value public int top() throws Exception { //Exception handling - if stack is empty if (isEmpty()) { throw new Exception("Stack is empty!"); } …

  10. 4. 9. Dynamic Array-Based Stacks - GitHub Pages

    Dynamic Array-Based Stacks ¶. The dynamic array-based stack contains an internal array (which will grow and shrink dynamically), and the index of the top of the stack. Or actually, the index …

Refresh