LIFE CODING WITH JAVA
Replace node with depth
Send Feedback
In a given Generic Tree, replace each node with its depth value. You need to just update the data of each node, no need to return or print anything. Depth of a node is defined as the distance of the node from root. You may assume that depth of root node is 0.
Sample Input 1 :
10 3 20 30 40 2 40 50 0 0 0 0
Representation of Input:
Sample Output 1 : (Level wise, each level in new line)
0
1 1 1
2 2
Explanation
Since root is 10 , so it's depth is 0
Node 20, 30 , 40 are present at 1st level , so their depth is 1.
Node 40,50 are present at 2nd level, so their depth is 2.
I try to solve very easy concept So please watch this video .
All java code with easy trick.
By "LIFE CODING WITH JAVA". all program free no any cost So please like ,subscribe, share and comment.
If you any doubt related to any video then comment me. As soon as I will help you .
my contact number: 6206472735..
#LIFE CODING WITH JAVA
@java62
#java
#coding
#with java
#for loops in java
#patterns in java
#while loops in java
#arrays in java
#dynamic in java
#linked list in java
#queue in java
#stack in java
#binary search in java
#merge search in java
#dsa in java
#recursion in java
#arraylist in java
#function in java
#all oops concept in java
#queue
#explain all concept related to java
#history of java
#only java course
#full stack web development
#coding ninjas all questions
In questa pagina del sito puoi guardare il video online Replace node with depth using Tree || coding ninjas || java della durata di ore minuti seconda in buona qualità , che l'utente ha caricato LIFE CODING WITH JAVA 18 settembre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 184 volte e gli è piaciuto 4 spettatori. Buona visione!