About 2,230,000 results
Open links in new tab
  1. Reverse a String using Stack - GeeksforGeeks

    Apr 4, 2025 · Follow the steps given below to reverse a string using stack. Create an empty stack. One by one push all characters of string to stack. One by one pop all characters from stack …

  2. Reverse an array using Stack - GeeksforGeeks

    Mar 25, 2025 · Follow the steps given below to reverse an array using stack. Create an empty stack. One by one push all elements of the array to stack. One by one pop all elements from …

  3. Java Program to Reverse a String using Stack - GeeksforGeeks

    Oct 21, 2020 · Convert character array to string. Return reversed string. Below is the implementation of the above approach. Time Complexity: O (n), where n is a number of …

  4. java - How do I reverse a String array? - Stack Overflow

    Nov 7, 2014 · To reverse the array you only have to iterate half of the array and start swapping the element from start with end. swap element (position from start) with element (end position - …

  5. Reverse a string using a stack data structure | Techie Delight

    Dec 1, 2021 · This post will discuss how to reverse a string using the stack data structure in C/C++, Java, and Python using explicit stack and call stack.

  6. java - Reversing an array using a stack - Stack Overflow

    Reverse int array using stack. strArr[i] = String.valueOf(arr[i]); stack.push(strArr[i]); strArr[i] = stack.pop(); arr[i] = Integer.parseInt(strArr[i]); public static void main(String[]args){ Integer arr[] …

  7. Java Program to Reverse a String Using Stack - Tpoint Tech

    Mar 17, 2025 · Approach to reverse a string using stack. Push the elements/characters of the string individually into the stack of datatype characters. Pop the elements/characters …

  8. Java Coding Challenge - Reverse a String using Stack - Java Guides

    In this blog post, we implemented a solution to reverse a string using a stack in Java. We walked through the logic step-by-step, explaining how the stack's LIFO principle helps reverse the …

  9. How do I reverse every string in a string array? - Stack Overflow

    May 19, 2020 · Simply iterate the array, and replace each entry with its reverse. You can use a StringBuilder to reverse a String, calling StringBuilder.reverse. Like, public static void …

  10. Reverse Elements of an Array Using Stack in Java - Online …

    System.out.println("Reversed array is ::"+Arrays.toString(reverseArray)); Learn how to reverse the elements of an array using a stack in Java with this step-by-step guide.

  11. Some results have been removed
Refresh