Tag: java
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. The given integer is guaranteed to fit within the …
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This is case sensitive, for …
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. You may assume k is always valid, 1 ≤ k ≤ BST’s …
The easiest Parallelism in Java could be achieved by the java.util.stream.Stream utility. As a good coding exercise, the following Java code will compute the Math PI constant based on …
Given a binary search tree and a target, find out if there are any two numbers in the BST that sums up to this target. Given a Binary Search …