gdata.io.handleScriptLoaded({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$georss":"http://www.georss.org/georss","xmlns$thr":"http://purl.org/syndication/thread/1.0","xmlns$blogger":"http://schemas.google.com/blogger/2008","id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385"},"updated":{"$t":"2023-12-09T13:35:10.032-08:00"},"category":[{"term":"Hackerrank Delete duplicate-value nodes from a sorted linked list Solution"},{"term":"Hackerrank Print the elements of a linked list solution"},{"term":"PATTERNS"},{"term":"pattern generation in c"},{"term":"c++ program"},{"term":"Hackerrank Reverse a doubly linked list solution"},{"term":"programming"},{"term":"TEXT ANALYZER"},{"term":"networks"},{"term":"triangle pattern c++"},{"term":"unipolar encoding simulation"},{"term":"Hackerrank Print in Reverse solution"},{"term":"c++"},{"term":"education"},{"term":"opps sandclock pattern"},{"term":"opps triangle pattern"},{"term":"Linked Lists in C++"},{"term":"coding"},{"term":"C++ Diamond Pattern"},{"term":"hourglass pattern c++"},{"term":"hackerrank"},{"term":"java"},{"term":"c"},{"term":"Utopian tree"},{"term":"lexical analyser"},{"term":"cpp"},{"term":"Hackerrank Insert a node into a sorted doubly linked list Solution"},{"term":"java program"},{"term":"mini project"},{"term":"c programming"},{"term":"operator precedence"}],"title":{"type":"text","$t":"GRK"},"subtitle":{"type":"html","$t":"A blog by Gokul Raj Kumar"},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/-/Utopian+tree?alt\u003djson-in-script\u0026max-results\u003d6"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/-/Utopian+tree?alt\u003djson-in-script\u0026max-results\u003d6"},{"rel":"alternate","type":"text/html","href":"http://blog.grkweb.com/search/label/Utopian%20tree"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"https://www.blogger.com/profile/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"generator":{"version":"7.00","uri":"https://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"1"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"6"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385.post-2178678384943778319"},"published":{"$t":"2014-09-23T09:46:00.003-07:00"},"updated":{"$t":"2022-01-16T20:38:16.592-08:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"c programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Utopian tree"},{"scheme":"http://www.blogger.com/atom/ns#","term":"c"},{"scheme":"http://www.blogger.com/atom/ns#","term":"hackerrank"}],"title":{"type":"text","$t":"Utopian Tree"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"msB\" style\u003d\"background-color: white; border: 0px; color: #39424e; font-family: \u0026quot;Whitney SSm A\u0026quot;, \u0026quot;Whitney SSm B\u0026quot;, verdana, \u0026quot;Lucida Grande\u0026quot;, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 22.4px; margin: 0px 0px 10px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\n\u003cdiv style\u003d\"border: 0px; font-size: 18px; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: 1.5em; margin-bottom: 1em; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\n\u003cstrong style\u003d\"border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003eProblem Statement\u003c/strong\u003e\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class\u003d\"msB\" style\u003d\"background-color: white; border: 0px; color: #39424e; font-family: \u0026quot;Whitney SSm A\u0026quot;, \u0026quot;Whitney SSm B\u0026quot;, verdana, \u0026quot;Lucida Grande\u0026quot;, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 22.4px; margin: 0px 0px 10px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\n\u003cdiv style\u003d\"border: 0px; font-size: 18px; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: 1.5em; margin-bottom: 1em; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\nThe Utopian Tree goes through 2 cycles of growth every year. The first growth cycle occurs during the spring, when it doubles in height. The second growth cycle occurs during the summer, when its height increases by 1 meter.\u0026nbsp;\u003cbr style\u003d\"overflow-wrap: break-word; word-break: break-word; word-wrap: break-word;\" /\u003eNow, a new Utopian Tree sapling is planted at the onset of spring. Its height is 1 meter. Can you find the height of the tree after\u0026nbsp;\u003cspan class\u003d\"MathJax_Preview\" style\u003d\"border: 0px; color: #888888; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003cspan aria-readonly\u003d\"true\" class\u003d\"MathJax\" id\u003d\"MathJax-Element-1-Frame\" role\u003d\"textbox\" style\u003d\"border: 0px; direction: ltr; display: inline; float: none; font-family: inherit; font-stretch: inherit; font-variant: inherit; line-height: normal; margin: 0px; max-height: none; max-width: none; min-height: 0px; min-width: 0px; outline: 0px; overflow-wrap: normal; padding: 0px; vertical-align: baseline; white-space: nowrap; word-break: break-word; word-spacing: normal; word-wrap: normal;\"\u003e\u003cnobr style\u003d\"-webkit-transition: none; border: 0px; margin: 0px; max-height: none; max-width: none; min-height: 0px; min-width: 0px; padding: 0px; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan class\u003d\"math\" id\u003d\"MathJax-Span-1\" style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; width: 1.131em; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 0px; margin: 0px; outline: 0px; padding: 0px; position: relative; transition: none; vertical-align: 0px; width: 0.906em; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan style\u003d\"-webkit-transition: none; border: 0px; clip: rect(1.673em 1000.002em 2.622em -0.359em); font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: 0.002em; margin: 0px; outline: 0px; padding: 0px; position: absolute; top: -2.482em; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan class\u003d\"mrow\" id\u003d\"MathJax-Span-2\" style\u003d\"-webkit-transition: none; border: 0px; display: inline; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan class\u003d\"mi\" id\u003d\"MathJax-Span-3\" style\u003d\"-webkit-transition: none; border: 0px; display: inline; font-family: MathJax_Math-italic; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003eN\u003cspan style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 1px; margin: 0px; outline: 0px; overflow: hidden; padding: 0px; position: static; transition: none; vertical-align: 0px; width: 0.093em; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 2.486em; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; width: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan style\u003d\"-webkit-transition: none; border-left-style: solid; border-width: 0px 0px 0px 0.003em; display: inline-block; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 0.947em; margin: 0px; outline: 0px; overflow: hidden; padding: 0px; position: static; transition: none; vertical-align: -0.053em; width: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/nobr\u003e\u003c/span\u003e\u0026nbsp;growth cycles?\u003c/div\u003e\n\u003c/div\u003e\n\u003ch3 style\u003d\"text-align: left;\"\u003e\nSOURCE CODE:\u003c/h3\u003e\n\u003cpre style\u003d\"background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;\"\u003e\u003ccode style\u003d\"color: black; overflow-wrap: normal; word-wrap: normal;\"\u003e #include\u0026lt;stdio.h\u0026gt;  \n void main()  \n {  \n   int t,test,total;  \n   scanf(\"%d\",\u0026amp;test);  \n   while(test--){  \n     scanf(\"%d\",\u0026amp;t);  \n     total\u003d1;  \n     int flag\u003d1;  \n     while(t--)  \n     {  \n       if(flag){  \n         if(total\u003d\u003d1){  \n           total+\u003d1;  \n         }else{  \n         total*\u003d2;  \n         }  \n       flag--;  \n       }  \n       else{  \n         total+\u003d1;  \n         flag++;  \n       }  \n     }  \n     printf(\"%d\\n\",total);  \n   }  \n }   \n\u003c/code\u003e\u003c/pre\u003e\n\u003cbr /\u003e\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://blog.grkweb.com/feeds/2178678384943778319/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://blog.grkweb.com/2014/09/utopian-tree.html#comment-form","title":"4 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/2178678384943778319"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/2178678384943778319"},{"rel":"alternate","type":"text/html","href":"https://blog.grkweb.com/2014/09/utopian-tree.html","title":"Utopian Tree"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"https://www.blogger.com/profile/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"4"}}]}});