@ALL this shud work :-) #include<iostream> #include<queue> using namespace std; queue<int> Q; void rev() { if(!Q.empty()) { int x=Q.front(); Q.pop(); rev(); Q.push(x); }
} main() { for(int i=1;i<12;i++) Q.push(i); rev(); while(!Q.empty()) { int x=Q.front(); Q.pop(); printf("%d ",x); } system("pause"); } On Thu, Jun 21, 2012 at 12:14 PM, sanjay pandey <sanjaypandey...@gmail.com> wrote: > it seems @hassan sol is correct....can nybody knw d flaw in it??? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.