MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / isSymmetric

Method isSymmetric

Java/symmetric-tree.java:13–18  ·  view source on GitHub ↗
(TreeNode root)

Source from the content-addressed store, hash-verified

11 */
12class Solution {
13 public boolean isSymmetric(TreeNode root) {
14 /* if root node of tree itself is null, then it's symmetric */
15 if(root==null)
16 return true;
17 return checkMirror(root.left, root.right);
18 }
19 public boolean checkMirror(TreeNode lt, TreeNode rt){
20 /* if root's left and root's right both are null, is then that subtree is symmetric */
21 if(lt==null && rt==null)

Callers

nothing calls this directly

Calls 1

checkMirrorMethod · 0.95

Tested by

no test coverage detected