1.Given a binary tree and a sum, determine if the tree has a root-to-leaf path such tha...
1.Given a binary tree and a sum, determine if the tree has a root-to-leaf path such tha...
Ex.8.14 Prove that the following problem is NP-complete: given an undirected graph G = ...
1.Given a binary tree, find its minimum depth. The minimum depth is the number of nodes...
1.Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its...
1.Implement int sqrt(int x).Compute and return the square root of x.x is guaranteed to ...
1.Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted...
1.Return the index of the first occurrence of needle in haystack, or -1 if needle is no...
1.Given an array and a value, remove all instances of that value in-place and return th...
1.Merge two sorted linked lists and return it as a new list. The new list should be mad...
1.Given numRows, generate the first numRows of Pascal's triangle. For example, given nu...
1.Given a string s consists of upper/lower-case alphabets and empty space characters ' ...
1.Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determ...
1.Determine whether an integer is a palindrome. Do this without extra space. Some hints...
1.Given two binary trees, write a function to check if they are equal or not. Two binar...
1.You are climbing a stair case. It takes n steps to reach to the top. Each time you ca...
1.The count-and-say sequence is the sequence of integers with the first five terms as f...
1.Given a sorted array and a target value, return the index if the target is found. If ...
1.Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return...