Cisco Systems Interview Question: Write a program to reverse a ... | Glassdoor

Interview Question

Intern - Software Engineer - Cisco Choice Interview(Student Candidate) San Jose, CA

Write a program to reverse a string

Answer

Interview Answer

3 Answers

2

String reverse(String s){
int length = s.length()-1
String s1 = ""
while (length >= 0){
s1 = s1 + s[length]
length--
}

return s1

}

Jason Peng on Nov 10, 2012
0

forget semicolumns (;), sorry

Jason Peng on Nov 10, 2012
0

Push char by char on a stack then concatenate all the pops until the stack is empty.

A on Apr 29, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.