tag:blogger.com,1999:blog-2682781734368178743.post558934194029345602..comments2023-03-28T14:19:44.264-07:00Comments on Technical Interview Questions, Answers, and Tips: Implement Two stacks using one arrayUnknownnoreply@blogger.comBlogger10125tag:blogger.com,1999:blog-2682781734368178743.post-56046580602872596302012-07-28T23:09:46.901-07:002012-07-28T23:09:46.901-07:00I think there is no need of stackATop < stackB...I think there is no need of stackATop < stackBTop this condition in pop to stack<br />and similarly for stackb...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-67241338704070689562011-09-11T18:10:44.174-07:002011-09-11T18:10:44.174-07:00>> In the popStackA() operation, isn't i...>> In the popStackA() operation, isn't it enough if we check stackATop >= 0 alone.<br />Why do we bother whether stackATop < stackBTop too?<br /><br />I agreeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-53217524039013235572011-05-10T09:51:28.911-07:002011-05-10T09:51:28.911-07:00In the popStackA() operation, isn't it enough ...In the popStackA() operation, isn't it enough if we check stackATop >= 0 alone.<br />Why do we bother whether stackATop < stackBTop too?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-60632606298334463752011-01-20T04:52:58.536-08:002011-01-20T04:52:58.536-08:00In implement two stacks in one array push is very ...In implement two stacks in one array push is very easy. but pop is difficult.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-47437783870154565162010-11-11T05:51:07.173-08:002010-11-11T05:51:07.173-08:00need to implement it using C programme.need to implement it using C programme.savithahttps://www.blogger.com/profile/02425764471283488547noreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-23705074251727097732010-11-11T05:49:37.876-08:002010-11-11T05:49:37.876-08:00actually my instructor asked me this following que...actually my instructor asked me this following question , can u pls help me out in understanding this concept<br />can many stacks be implemented using 1 push and 1 pop? <br />can it be of different of different size? if NO what modification has to be done to make it YES?savithahttps://www.blogger.com/profile/02425764471283488547noreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-20269113467252159142010-11-11T05:44:09.200-08:002010-11-11T05:44:09.200-08:00thanksthankssavithahttps://www.blogger.com/profile/02425764471283488547noreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-38486313805856550372010-11-09T21:36:31.746-08:002010-11-09T21:36:31.746-08:00Savitha,
The advantage is you can get by with a si...Savitha,<br />The advantage is you can get by with a single buffer (save memory). This is true only if only one of the stacks is bigger than the other and you don't know the potential sizes of the stacks. This is how stack and heap are laid out for an operating system process. They both grow towards each other.<br /><br />The disadvantage is it complicates things a big since you have to makeavid gardenerhttps://www.blogger.com/profile/08838915050477665426noreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-80104421525744870592010-11-03T08:43:10.238-07:002010-11-03T08:43:10.238-07:00what are the advantages and disadvantages of imple...what are the advantages and disadvantages of implementing 2 or n stacks using single array?savithahttps://www.blogger.com/profile/02425764471283488547noreply@blogger.comtag:blogger.com,1999:blog-2682781734368178743.post-7624384917512631832010-10-17T11:31:49.293-07:002010-10-17T11:31:49.293-07:00Helped me a lot..Thanx :)Helped me a lot..Thanx :)Anonymousnoreply@blogger.com