摘要:
题目:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integ... 阅读全文
摘要:
题目:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array w... 阅读全文
摘要:
题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum... 阅读全文
摘要:
Hashtable:1. key和value都不许有null值2. 使用enumeration遍历3. 同步的,每次只有一个线程能够访问4. 在java中Hashtable是H大写,t小写,而HashMap是H大写,M大写HashMap:1. key和value可以有null值2. 使用itera... 阅读全文
摘要:
题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the tw... 阅读全文
摘要:
题目:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a funct... 阅读全文