Tag: data structure
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: Almost every tree …
Given a binary tree, return its inorder traversal of its nodes’ values. For example: The binary tree, 1 \ 2 / 3 should return the inorder = . Recursion …
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two …
A Binary Search Tree (BST) is a binary tree that satisfies the following requirements: The value of a parent node is bigger than all values of its left sub …
A Singly Linked List is a one-direction List that uses a pointer to connect between Nodes. To reverse a linked list, you need to re-connect the directions, for example: …