// API callback
related_results_labels_thumbs({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$blogger":"http://schemas.google.com/blogger/2008","xmlns$georss":"http://www.georss.org/georss","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$thr":"http://purl.org/syndication/thread/1.0","id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385"},"updated":{"$t":"2023-12-09T13:35:10.032-08:00"},"category":[{"term":"cpp"},{"term":"c++"},{"term":"hackerrank"},{"term":"c++ program"},{"term":"Linked Lists in C++"},{"term":"c"},{"term":"c programming"},{"term":"programming"},{"term":"PATTERNS"},{"term":"coding"},{"term":"C++ Diamond Pattern"},{"term":"Hackerrank Delete duplicate-value nodes from a sorted linked list Solution"},{"term":"Hackerrank Insert a node into a sorted doubly linked list Solution"},{"term":"Hackerrank Print in Reverse solution"},{"term":"Hackerrank Print the elements of a linked list solution"},{"term":"Hackerrank Reverse a doubly linked list solution"},{"term":"TEXT ANALYZER"},{"term":"Utopian tree"},{"term":"education"},{"term":"hourglass pattern c++"},{"term":"java"},{"term":"java program"},{"term":"lexical analyser"},{"term":"mini project"},{"term":"networks"},{"term":"operator precedence"},{"term":"opps sandclock pattern"},{"term":"opps triangle pattern"},{"term":"pattern generation in c"},{"term":"triangle pattern c++"},{"term":"unipolar encoding simulation"}],"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:\/\/blog.grkweb.com\/feeds\/posts\/default"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/5735018943946871385\/posts\/default\/-\/Hackerrank+Print+the+elements+of+a+linked+list+solution?alt=json-in-script\u0026max-results=6"},{"rel":"alternate","type":"text/html","href":"https:\/\/blog.grkweb.com\/search\/label\/Hackerrank%20Print%20the%20elements%20of%20a%20linked%20list%20solution"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"generator":{"version":"7.00","uri":"http://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-8139343959882141605"},"published":{"$t":"2015-04-18T08:15:00.006-07:00"},"updated":{"$t":"2022-01-16T10:04:59.553-08:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"c++"},{"scheme":"http://www.blogger.com/atom/ns#","term":"c++ program"},{"scheme":"http://www.blogger.com/atom/ns#","term":"cpp"},{"scheme":"http://www.blogger.com/atom/ns#","term":"hackerrank"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Hackerrank Print the elements of a linked list solution"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Linked Lists in C++"}],"title":{"type":"text","$t":"Print the elements of a linked list solution"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Ch2 style=\"text-align: left;\"\u003E\nProblem Statement\u003C\/h2\u003EYou’re given the pointer to the head node of a linked list and you need to print all its elements in order, one element per line. The head pointer may be null, i.e., it may be an empty list. In that case, don’t print anything!\u003Cbr \/\u003E\n\u003Ch2 style=\"text-align: left;\"\u003E\nSource code:\u003C\/h2\u003E\n\u003Cpre style=\"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=\"color: black; overflow-wrap: normal; word-wrap: normal;\"\u003E \/*  \n  Print elements of a linked list on console   \n  head pointer input could be NULL as well for empty list  \n  Node is defined as   \n  struct Node  \n  {  \n    int data;  \n    struct Node *next;  \n  }  \n *\/  \n void Print(Node *head)  \n {  \n  \/\/ This is a \"method-only\" submission.   \n  \/\/ You only need to complete this method.   \n   while(head!=NULL){  \n     cout\u0026lt;\u0026lt;head-\u0026gt;data\u0026lt;\u0026lt;endl;  \n     head = head-\u0026gt;next;  \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\/8139343959882141605\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/blog.grkweb.com\/2015\/04\/hackerrank-print-elements-of-linked.html#comment-form","title":"3 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/5735018943946871385\/posts\/default\/8139343959882141605"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/5735018943946871385\/posts\/default\/8139343959882141605"},{"rel":"alternate","type":"text/html","href":"https:\/\/blog.grkweb.com\/2015\/04\/hackerrank-print-elements-of-linked.html","title":"Print the elements of a linked list solution"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"3"}}]}});