mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-21 13:20:56 +07:00
15 lines
242 B
Java
15 lines
242 B
Java
class Test {
|
|
|
|
Node findRoot(Node n) {
|
|
while(true) {
|
|
Node temp = n.getParent();
|
|
if (!(temp != null)) break;
|
|
n = temp;
|
|
}
|
|
return n;
|
|
}
|
|
}
|
|
interface Node {
|
|
Node getParent();
|
|
}
|