tag:blogger.com,1999:blog-3675582796619590206.post4025464738249826606..comments2024-03-19T15:01:12.924+06:00Comments on I, ME AND MYSELF !!!: SPOJ ARRAYSUBZobayer Hasanhttp://www.blogger.com/profile/10946508827987290398noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3675582796619590206.post-68870486110556240862013-10-24T14:41:21.974+06:002013-10-24T14:41:21.974+06:00Yap, I mentioned the linear solution in my second ...Yap, I mentioned the linear solution in my second comment to George Christoglou above. Its probably the same as the monotonic queue.Zobayer Hasanhttps://www.blogger.com/profile/10946508827987290398noreply@blogger.comtag:blogger.com,1999:blog-3675582796619590206.post-8654897182893087682013-10-24T00:26:13.556+06:002013-10-24T00:26:13.556+06:00Another solution maybe Sliding Window RMQ, isn'...Another solution maybe Sliding Window RMQ, isn't it ? BTW, is Sliding RMQ similar to monotonic queue ?আহমদ ফাইয়াজhttps://www.blogger.com/profile/13247134024136987429noreply@blogger.comtag:blogger.com,1999:blog-3675582796619590206.post-23696090611924908192013-03-30T15:45:35.092+06:002013-03-30T15:45:35.092+06:00Exactly :D , good luck with your interviews!!Exactly :D , good luck with your interviews!!George Christoglouhttps://www.blogger.com/profile/04056062428390992299noreply@blogger.comtag:blogger.com,1999:blog-3675582796619590206.post-62747961393681291732013-03-29T00:12:11.883+06:002013-03-29T00:12:11.883+06:00yah, I also solved this using a double ended queue...yah, I also solved this using a double ended queue, if current item is smaller than q head, then keep popping until you find some item larger than current one and then push the current value, other wise push it at the end of the queue. at any time queue head contains the required value.Zobayer Hasanhttps://www.blogger.com/profile/10946508827987290398noreply@blogger.comtag:blogger.com,1999:blog-3675582796619590206.post-82354746798072521152013-03-29T00:00:18.010+06:002013-03-29T00:00:18.010+06:00It can be solved also in O(N) using monotonic queu...It can be solved also in O(N) using monotonic queue.George Christoglouhttps://www.blogger.com/profile/04056062428390992299noreply@blogger.com