- 博客(4)
- 收藏
- 关注
原创 [leetcode]C语言:169 Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element always
2015-03-21 20:08:48 396
原创 [leetcode]C语言:171 Excel Sheet Column Number
Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example:A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 int
2015-03-21 20:05:40 398
原创 [leetcode]C语言:172 Factorial Trailing Zeroes
**Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity.**int trailingZeroes(int n) { int s=0; while ((n/5)!=0) {
2015-03-16 18:08:19 376
原创 [leetcode]C语言:189 Rotate Array
void rotate(int nums[], int n, int k) { int temp; int nums1[n]; for (int y=0;y<n;y++){ nums1[(y+k+n)%n]=nums[y+n%n]; } for (int i=0;i<n;i++){ nums[i]=nums1[i];} }
2015-03-16 17:44:26 360
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人