I need 2 different algorithms of this code to reverse array of integers using stack
- or -
Post a project like this3769
$20
- Posted:
- Proposals: 8
- Remote
- #382601
- Awarded
Master of Computer Applications (MCA), Graduate in Mathematics(BSC), having 9 years of experience in Software Development
Bangalore
157680432743494767570415570946572996490573572578
Description
Experience Level: Entry
Estimated project duration: 1 day or less
General information for the business: We repair computers
Kind of development: Customization of existing program
Description of requirements/functionality:
import java.util.*;
class ArrayReverse{
public static void main (String [] args){
// Creating the unsorted Array
String [] unReversed = {"10","9","8","7","6","5","4","3","2","1"};
// Creating the Stack which will be used to reverse the Array
Stack Reversed = new Stack();
// While-loop to print the Array
System.out.println("This is your Array before reversing");
for(int i = 0; i<unReversed.length; i++){
System.out.println(unReversed[i]);
}
// For-loop to insert elements from array into stack
for(int i = 0; i<unReversed.length; i++){
Reversed.add(unReversed[i]);
}
System.out.println("\n\n");
System.out.println("This is your Array after reversing");
while (!Reversed.isEmpty()){
System.out.println(Reversed.pop());
}
}
}
Extra notes:
Kind of development: Customization of existing program
Description of requirements/functionality:
import java.util.*;
class ArrayReverse{
public static void main (String [] args){
// Creating the unsorted Array
String [] unReversed = {"10","9","8","7","6","5","4","3","2","1"};
// Creating the Stack which will be used to reverse the Array
Stack Reversed = new Stack();
// While-loop to print the Array
System.out.println("This is your Array before reversing");
for(int i = 0; i<unReversed.length; i++){
System.out.println(unReversed[i]);
}
// For-loop to insert elements from array into stack
for(int i = 0; i<unReversed.length; i++){
Reversed.add(unReversed[i]);
}
System.out.println("\n\n");
System.out.println("This is your Array after reversing");
while (!Reversed.isEmpty()){
System.out.println(Reversed.pop());
}
}
}
Extra notes:
Mazen A.
100% (1)Projects Completed
1
Freelancers worked with
1
Projects awarded
50%
Last project
17 Jan 2014
Saudi Arabia
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies