---
title: "Discussion on \"Same Tree (Easy)\" | Hashnode"
description: "Discussion on \"Same Tree (Easy)\". Given the roots of two binary trees p and q, write a function to check if they are the same or not.\nTwo binary trees are considered the same if they are structurally identical, and the nodes have the same value.\nExample 1:\n\nInput: p = [1,2,3], q = [1..."
url: "https://hashnode.com/posts/same-tree-easy/66787ec38f0dd18da2f82d5f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Same Tree (Easy)](https://lietcode.hashnode.dev/same-tree-easy?utm_source=hashnode&utm_medium=feed)

Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the same value. Example 1: Input: p = \[1,2,3\], q = \[1...

Jun 23, 2024 · 3 min read · lietcode.hashnode.dev  
Read the article

-   [#tree](https://hashnode.com/tag/tree)

## Written by

[Abhi](https://hashnode.com/@lietcode)

@lietcode

  
[View profile](https://hashnode.com/@lietcode)

Let's crack the interviews

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
