- 博客(10)
- 收藏
- 关注
转载 产生个N个不重复随机数数的快速算法
转自: http://blog.youkuaiyun.com/devfun/article/details/6534476 伪代码int startArray[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};//seed arrayint length = sizeof(startArray)/sizeof(int); int N = 10;//随机数个
2017-03-26 20:57:13
5833
转载 (转载)c++实现反射机制
看到不错的分享一下,有侵犯权利请联系我删除,谢谢,转自 :http://blog.youkuaiyun.com/y1196645376/article/details/51455273 一.前言: Java有着一个非常突出的动态相关机制:Reflection,用在Java身上指的是我们可以于运行时加载、探知、使用编译期间完全未知的classes。换句话说,Java程序可以加载一个运行时才得知名称的
2017-03-07 22:43:01
305
转载 itoa microsoft 版本
附上itoa microsoft 版本代码, 只能转换2-36进制 (36限制是因为 0-9 a-z 一共36个字符,大于36的话只能用乱码表示了) TCHAR * __cdecl _itox ( int val, TCHAR *buf, int radix ) { if (radix == 1
2017-02-28 16:27:19
489
原创 leetcode - 8. String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca
2017-02-28 11:25:03
332
原创 leetcode - 496. Next Greater Element I (stack)
ou are given two arrays (without duplicates) nums1 and nums2where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2.
2017-02-24 10:11:56
265
原创 leetcode - 338. Counting Bits (bit mannipulation)
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array. Example: For num = 5
2017-02-23 16:04:20
313
原创 leetcode - 500. Keyboard Row (map)
Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Example 1: Input: ["Hello", "Alaska", "Da
2017-02-23 11:28:18
467
原创 leetcode - 419. Battleships in a Board (logic)
Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may assume the following rules: You receive a valid
2017-02-22 22:53:03
245
原创 leetcode - 476. Number Complement (bit mannipulation)
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range
2017-02-22 22:36:24
292
原创 leetcode - 461. Hamming Distance (bit mannipulation)
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x,
2017-02-22 22:32:47
239
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人