Category: data structure
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 …
Given two binary strings, return their sum (also a binary string). For example, a = “11” b = “1” Return “100”. It looks easy however may not seem so: …
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums = nums and …
Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings …
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 …