tag:blogger.com,1999:blog-4228859841453048938.post2534609273045915156..comments2024-03-28T19:53:14.045+08:00Comments on Coding Interview Questions: No. 02 - Stack with Function min()Harry Hehttp://www.blogger.com/profile/10363303096963693183noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-4228859841453048938.post-34432451698402632132020-02-08T22:29:10.547+08:002020-02-08T22:29:10.547+08:00Thank you sharing this Information
I also found V...Thank you sharing this Information <br />I also found Various useful links related to Devops, Docker & Kubernetes <br /><br /><br /><a href="http://linux.amitmaheshwari.in/2020/02/kubernetes-kubectl-commands-cheatsheet.html" rel="nofollow"> Kubernetes Kubectl Commands CheatSheet </a><br /><br /><a href="http://linux.amitmaheshwari.in/2020/02/introduction-to-kubernetes-networking.html" rel="nofollow"> Introduction to Kubernetes Networking </a><br /><br /><a href="http://linux.amitmaheshwari.in/2020/02/basic-concept-of-kubernetes.html" rel="nofollow"> Basic Concept of Kubernetes </a><br /><br /><a href="http://linux.amitmaheshwari.in/2019/11/kubernetes-interview-questions-and.html" rel="nofollow"> Kubernetes Interview Question and Answers </a><br /><br /><a href="http://linux.amitmaheshwari.in/2020/02/kubernetes-kubectl-commands-cheatsheet.html" rel="nofollow"> Kubernetes Sheetsheat </a><br /><br /><a href="http://linux.amitmaheshwari.in/2019/11/docker-interview-questions-and-answers.html" rel="nofollow"> Docker Interview Question and Answers </a><br /><br /><a href="http://linux.amitmaheshwari.in/2019/12/docker-basic-tutorial.html" rel="nofollow"> Docker Basic Tutorial </a>Editorhttps://www.blogger.com/profile/08032442576837072724noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-62103837742656932392018-06-09T14:39:09.798+08:002018-06-09T14:39:09.798+08:00Howdy Mate,
This is indeed great! But I think pe...Howdy Mate,<br /><br /><br />This is indeed great! But I think perhaps you are generally referring No. 02 - Stack with Function min() which is getting unsustainable.<br /><br /><br />I have a problem with cost allocation tags. I added a number of custom tags to my AWS resources. Activated the tags using activation GUI. I can see the tag keys as dimensions for Cost Explorer filters but no tag values are shown for filtering (only record "No TagKey"). More than a week passed since I added and activated the tags but nothing changes. Please advise. <a href="https://www.youtube.com/watch?v=M-vNN1ntJDo&index=1&list=PLVNl9sThbR3FTwlKNHDDTZlxrfwqx8c0l" rel="nofollow"> AWS Training </a><br /><br /><br /><br /><br /><br />Once again thanks for your tutorial.<br /><br /><br />Merci Beaucoup,<br />AjeethAnonymoushttps://www.blogger.com/profile/11674257547961232200noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-60839612035129065202018-06-06T19:41:36.830+08:002018-06-06T19:41:36.830+08:00Hey Brother,
Seems like I won the lottery here….T...Hey Brother,<br /><br />Seems like I won the lottery here….This is a treasure box of blogs and your folks are like leprechauns! Phenomenal read on No. 02 - Stack with Function min() <a href="https://asha24.com/blog/aws-tutorials-training-certification-and-interview-qa/" rel="nofollow"> AWS Training USA </a><br /><br />We have a t2.micro instance (built from amzn-ami-hvm-2016.09.1.20170119-x86_64-gp2) on which a customized WordPress is deployed. Following various posts here and elsewhere, various parameters for Apache and MySQL have been set to accommodate the 'size' of the host, including the deployment of a swap partition. The site has been running without issue for weeks.<br /><br />Please keep providing such valuable information.<br /><br />Shukran,<br />Irene HynesAnonymoushttps://www.blogger.com/profile/01329230669792273903noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-24776000602832913002018-05-31T20:01:14.642+08:002018-05-31T20:01:14.642+08:00Hello Harry,
A really interesting, clear and easi...Hello Harry,<br /><br />A really interesting, clear and easily readable Stack with Function min() article of interesting and different perspectives. I will clap. So much is so well covered here.<br /><br /><br />However, when. ebignore is present in your project directory, the EB CLI doesn't use git commands and semantics to create your source bundle. This means that EB CLI ignores files specified in. ebignore and includes all other files. In particular, it includes uncommitted source files.<br /><br /><a href="https://asha24.com/aws-certification-training" rel="nofollow"> Encryption should be considered for sensitive data, </a> as AWS S3 is a proprietary technology developed by Amazon themselves, and as yet unproven vis-a-vis a security standpoint.<br /><br />Anyways great write up, your efforts are much appreciated.<br /><br />Grazie,<br />KevinAnonymoushttps://www.blogger.com/profile/02198548195213794657noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-45612823155694686692017-01-07T20:18:19.012+08:002017-01-07T20:18:19.012+08:00What a wonderful post. I would like to say that th...What a wonderful post. I would like to say that this post is really very informational post. I really like it. <a href="http://www.secondarydataanalysis.net/faqs-on-how-to-do-secondary-data-analysis/" rel="nofollow">how to do secondary data analysis</a>aliyaahttps://www.blogger.com/profile/06184256288293330921noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-86932211937049578882014-09-10T04:52:04.529+08:002014-09-10T04:52:04.529+08:00Solution 2 without using the auxiliary stack is qu...Solution 2 without using the auxiliary stack is quite a different approach, I loved reading it. Saurabh Sahahttps://www.blogger.com/profile/09992117679652224469noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-16480441138799141082014-09-05T18:55:53.078+08:002014-09-05T18:55:53.078+08:00Hi Manikanda,
We need to return m_min from POP(),...Hi Manikanda, <br />We need to return m_min from POP(), if the control goes to below if block.<br /> if(m_data.top() < m_min)<br /> m_min = 2 * m_min - m_data.top();<br /><br />Harry mentioned same in TOP() but missed in POP().<br />Anonymoushttps://www.blogger.com/profile/14726020579034911054noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-19636659602606499732014-09-02T19:39:43.790+08:002014-09-02T19:39:43.790+08:00Its simply superb.Feeling good to share the link t...Its simply superb.Feeling good to share the link to practice <a href="http://skillgun.com/csharp/interview-questions-and-answers" rel="nofollow">c# interview questions </a><br /><br />@ <a href="http://skillgun.com/" rel="nofollow">http://skillgun.com</a>Anonymoushttps://www.blogger.com/profile/06516077129345612609noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-30679154055353632752014-05-09T16:10:26.914+08:002014-05-09T16:10:26.914+08:00What about overflow issue ?What about overflow issue ?ZANhttps://www.blogger.com/profile/15649927245071217099noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-88734517273468190992013-07-14T04:30:14.107+08:002013-07-14T04:30:14.107+08:00Can't we just compare the topmost element with...Can't we just compare the topmost element with the element that we are going to push into the stack, and this way we have to perform constant number of push and pop operations each time we push a new element to the top which will be minimum always.Jerry Mohanhttps://www.blogger.com/profile/17398583910678120535noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-5798455114761199992013-06-17T09:01:20.244+08:002013-06-17T09:01:20.244+08:00This is really nice. Thanks!This is really nice. Thanks!Shobhit Vermahttps://www.blogger.com/profile/17823959573934177739noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-2946628460486859242013-03-04T12:23:47.916+08:002013-03-04T12:23:47.916+08:00The implimentation of stack using linkedlist is be...The implimentation of stack using linkedlist is below :)<br /><a href="http://msumca2012.blogspot.in/2013/03/ds-a62-operation-on-stack-in-linked-list.html" rel="nofollow"><br />Stack using Linked List></a><br /><br />... :-) .....Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-33298818659210365442013-02-09T02:35:45.814+08:002013-02-09T02:35:45.814+08:00what if i'm passing the value as INT_MIN? it w...what if i'm passing the value as INT_MIN? it would failBaskarhttps://www.blogger.com/profile/09608575418790059849noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-25459329288591216932012-08-30T02:24:00.654+08:002012-08-30T02:24:00.654+08:00I like this solution against auxiliary stack but w...I like this solution against auxiliary stack but without auxiliary stack the solution given by Harry is awesome!Anonymoushttps://www.blogger.com/profile/14289356793580106631noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-10500661076138454982012-07-25T13:09:21.028+08:002012-07-25T13:09:21.028+08:00This comment has been removed by the author.ianhttps://www.blogger.com/profile/08747614720297840584noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-70440310513641552172012-04-09T20:11:12.318+08:002012-04-09T20:11:12.318+08:00when you say 2*1 = 2 , then the value to be popped...when you say 2*1 = 2 , then the value to be popped is the multiplying factor ie 1 and the new value of min is the result ie 2 .. read the code again..anujahttps://www.blogger.com/profile/07886397776167062302noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-19863434211052861322012-03-06T02:26:22.399+08:002012-03-06T02:26:22.399+08:00Harry I think your second solution wont stand good...Harry I think your second solution wont stand good for all cases. Consider below<br /><br />Stack empty.<br />1. Push 3<br /> stack=3 min_val = 3<br />2. Push 4<br /> stack = 3,4 min_val = 3<br />3. Push 2<br /> stack = 3,4,1(2*2 - 3 =1) min_val = 2<br />4. Push 1<br /> stack = 3,4,0(2*1-2=0) min_val = 1.<br /><br />Now start poping<br />1. 0< min_val(1)<br /> So 2*1 - 0 = 2<br /> But value to be popped is 1<br /><br />Even in you code while pushing you are updating value and pushing it but while popping you simply pop it out.Manikandanhttps://www.blogger.com/profile/15844762674749118157noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-40980442588284780942012-01-29T10:17:47.711+08:002012-01-29T10:17:47.711+08:00The function stack.pop removes the element on the ...The function stack.pop removes the element on the top. For for information, please refer to http://www.cplusplus.com/reference/stl/stack/pop/.Harry Hehttps://www.blogger.com/profile/10363303096963693183noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-43694629129832007582012-01-29T05:09:34.818+08:002012-01-29T05:09:34.818+08:00Another way(just one method, is not better than yo...Another way(just one method, is not better than yours), I can implement this question by having each node value and "CURRENT" the minimum min together.<br /><br />class NewNode<br />{<br /> public T value;<br /> public T min;<br />}<br /><br />Just one thought, it is easy, but waste more memory.jiaji.lihttps://www.blogger.com/profile/08201337716238788564noreply@blogger.comtag:blogger.com,1999:blog-4228859841453048938.post-38641585439942087582012-01-29T05:04:01.318+08:002012-01-29T05:04:01.318+08:00Thanks Harry sharing the question.
I am not famili...Thanks Harry sharing the question.<br />I am not familiar with STL, just wonder stack.pop() means stack.peek()?jiaji.lihttps://www.blogger.com/profile/08201337716238788564noreply@blogger.com