Tree: Inorder Traversal HackerRank Solution


Tree: Inorder Traversal HackerRank Solution
Source : https://www.hackerrank.com/challenges/tree-inorder-traversal



Source : https://www.hackerrank.com/challenges/tree-inorder-traversal


Solution


// Karthikalapati.blogspot.com
/*
Node is defined as
class Node {
int data;
Node left;
Node right;
}
*/
void inOrder(Node n) {
if (n != null) {
inOrder(n.left);
System.out.print(n.data + " ");
inOrder(n.right);
}
}

1 comment:

  1. Microsoft Windows 8.1

    Microsoft Windows 8.1 PC Product License Key This Product is delivered electronically and does not consist of any DVD, USB or any media. Delivery time is sameday (can take up to 24 hours) You will receive via Email: Official software product license

    https://softwarebase.uk/microsoft-windows-8-1

    ReplyDelete