摘要:
What’s a Hash Table? Why we need a Hash Table?By Using a Hash Table we can find element very quickly. For example, There are 20 random number in an array below.It’s not a sorted array, So We can not useBinary Searchto finding a number, When we need to find 118, We need 12 comparisons! Finding number 阅读全文
摘要:
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?class Solution{ int FindSingleNumber(int num[], int n) { if(NULL == num || n <= 0) ... 阅读全文