I need to reverse odd number in a list and even number in another list, I have give input as 1,2,3,4,5, and so on can any one please suggest me an efficient way to do this?
Loading
I need to reverse odd number in a list and even number in another list, I have give input as 1,2,3,4,5, and so on can any one please suggest me an efficient way to do this?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Selva GanapathyPosted Sep 24, 2014, 7:30 AM
Hi Jegan Priya,
http://www.c-sharpcorner.com/UploadFile/6f0898/the-circular-stack-an-advance-in-data-structure/
You can use the above structure to meet your requirement in which you can push the odd number in front stack and even number in back stack And pop up to reverse the number
Regards,
Selva Ganapathy K
VulpesPosted Sep 23, 2014, 2:20 PM
nathaJegamoorty PillaiPosted Sep 23, 2014, 1:32 PM
i Vulpes,
Thanks, but now need to store the numbers in a single structure that have two separate list, Please suggest me in this requirement
VulpesPosted Sep 23, 2014, 11:22 AM
The output is: