Print the Elements of a Linked List HackerRank Solution


Print the Elements of a Linked List HackerRank Solution
Source : https://www.hackerrank.com/challenges/print-the-elements-of-a-linked-list



Source : https://www.hackerrank.com/challenges/print-the-elements-of-a-linked-list


Solution


// Karthikalapati.blogspot.com
/*
Print elements of a linked list on console
Node is defined as
class Node {
int data;
Node next;
}
*/
void Print(Node head) {
Node n = head;
while (n != null) {
System.out.println(n.data);
n = n.next;
}
}

1 comment:

  1. 欢迎访问广发体育( GFTY SPORTS )官方下载中心,立即下载广发体育APP体验最新的足球篮球体育赛事、娱乐游戏,每天为您提供近千场精彩体育比分竞猜,互动娱乐在线直播平台,让玩家游戏的同时与女主播表演、参与互动游戏,广发全心全意为您提供最优质的服务。注册即赠送688,登录领取更多广发体育官方福利。广发体育APP官方下载网址: https://gf-ty.com

    #广发体育 #广发体育官网 #广发体育APP

    ReplyDelete