- 博客(11)
- 收藏
- 关注
原创 [389]Find the Difference
【题目描述】Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the lett
2016-08-31 21:58:29 209
原创 [1] Two Sum
【题目描述】Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:
2016-08-31 21:27:58 204
原创 [299] Bulls and Cows
[题目描述]You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you prov
2016-08-31 15:01:36 246
原创 [345]Reverse Vowels of a String
【题目描述】Write a function that takes a string as input and reverse only the vowels of a string.Example 1:Given s = "hello", return "holle".Example 2:Given s = "leetcode", return "leotce
2016-08-31 11:01:18 216
原创 [342] Power of Four
【题目描述】Given an integer (signed 32 bits), write a function to check whether it is a power of 4.Example:Given num = 16, return true. Given num = 5, return false.Follow up: Could you solv
2016-08-27 21:22:27 353
原创 [387] First Unique Character in a String
【题目描述】Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2.
2016-08-27 21:13:47 318
原创 [326]Power of Three
【题目描述】Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?【题目思路】如果是3的幂必然取以3为底的对数得到的是整数,而stl库里有log的函数,
2016-08-27 20:28:08 367
原创 [350]Intersection of Two Arrays II
【题目描述】Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should
2016-08-21 21:00:13 176
原创 [349]Intersection of Two Arrays
【题目描述】Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the result must be un
2016-08-21 20:22:36 146
原创 [383]Ransom Note
【题目描述】 Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can
2016-08-21 17:19:04 301
转载 线程安全和线程不安全理解
转载自:http://blog.csdn.net/ghevinn/article/details/37764791线程安全就是多线程访问时,采用了加锁机制,当一个线程访问该类的某个数据时,进行保护,其他线程不能进行访问直到该线程读取完,其他线程才可使用。不会出现数据不一致或者数据污染。 线程不安全就是不提供数据访问保护,有可能出现多个线程先后更改数据造成所得到的数据是脏数据
2016-08-21 15:32:11 347
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人