Tag: C++ coding exercise
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 …
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 …