Count Good Nodes in Binary Tree - Kotlin (Medium)Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. Return the number of good nodes in the binary tree. Example 1: Input: root = [3,1,4,3,null,1,5] Output: 4 Exp...1 min read·abhiculous.hashnode.devFeb 19, 2022
Balanced Binary Tree - Kotlina binary tree in which the left and right subtrees of every node differ in height by no more than 1.1 min read·abhiculous.hashnode.devFeb 19, 2022
Trees Implementationclass 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...3 min read·abhiculous.hashnode.devJan 22, 2022
Queue Implementation In Kotlin -Data Structure And AlgorithmsQueue are data structure that follows the FIRST IN, FIRST OUT (FIFO), ie the first element that is added to the queue is the first one to be removed. Elements are always added to the back and removed from the front. Think of it as a line of people, ...2 min read·abhiculous.hashnode.devJan 16, 2022
Stacks Implementation In Kotlin -Data Structure And AlgorithmsStack is an abstract data type with a bounded(predefined) capacity. It is a simple data structure that allows adding and removing elements in a particular order. Every time an element is added, it goes on the top of the stack and the only element tha...2 min read·abhiculous.hashnode.devJan 16, 2022