Array Reverse

来源:互联网 发布:淘宝店铺绑定旺旺 编辑:程序博客网 时间:2024/05/01 06:37

This is practice for data structures.

1. array reverse

Question: (on geeksforgeeks.com )


Input:   str = "a,b$c"Output:  str = "c,b$a"Note that $ and , are not moved anywhere.  Only subsequence "abc" is reversedInput:   str = "Ab,c,de!$"Output:  str = "ed,c,bA!$"


Answer:

refer to :

http://www.cnblogs.com/graphics/archive/2011/03/09/1977717.html

http://www.geeksforgeeks.org/reverse-an-array-without-affecting-special-characters/

0 0