---
title: "Discussion on \"Trees Implementation\" | Hashnode"
description: "Discussion on \"Trees Implementation\". class Tree {\n\n    data class Node(val value: Int) {\n        var leftNode: Node? = null\n        var rightNode: Node? = null\n    }\n\n    var rootNode: Node? = null\n\n    fun insert(value: Int) {\n        val newNode = Node(value)\n        if (rootNode == n..."
url: "https://hashnode.com/posts/trees-implementation/61ec4704a12088017fbea31b"
---

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

Discussion

# [Trees Implementation](https://abhiculous.hashnode.dev/trees-implementation?utm_source=hashnode&utm_medium=feed)

class Tree { data class Node(val value: Int) { var leftNode: Node? = null var rightNode: Node? = null } var rootNode: Node? = null fun insert(value: Int) { val newNode = Node(value) if (rootNode == n...

Jan 22, 2022 · 3 min read · abhiculous.hashnode.dev  
Read the article

## Written by

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

@abhiculous

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

stay sleeppyy, stayy foolish

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
