Initializing Array Elements int[] myIntArray = new int[5] { 2, 4, 6, 8, 10 }; // longer syntax int[] myIntArray = { 2, 4, 6, 8, 10 }; ...
1.字符串的全排列问题描述:打印出原字符串中所有字符的所有排列。——将输入字符串中的每个字符作为一个不同的字符看待,即使它们是重复的,如'aaa'应打印6次。Python可以用生成器解决:def permutation(elements): if len(elements) <=1: ...
分类:
编程语言 时间:
2015-04-07 19:09:43
阅读次数:
168
Given a set of distinct integers, S , return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
For exam...
分类:
其他好文 时间:
2015-04-07 10:05:03
阅读次数:
127
题目:Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new length.
...
分类:
其他好文 时间:
2015-04-07 09:47:14
阅读次数:
130
题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't ...
分类:
其他好文 时间:
2015-04-07 09:41:55
阅读次数:
134
一:Spiral Matrix I
题目:
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5...
分类:
其他好文 时间:
2015-04-06 21:55:35
阅读次数:
151
题目:leetcode
Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given [100, 4, 200, 1, 3, 2]...
分类:
其他好文 时间:
2015-04-06 17:22:41
阅读次数:
160
一:Unique paths I
题目:
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplic...
分类:
其他好文 时间:
2015-04-06 15:44:07
阅读次数:
122
#include void bubble_sort(long [], long);int main(){ long array[100], n, c, d, swap; printf("Enter number of elements\n"); scanf("%ld", &n); print...
分类:
编程语言 时间:
2015-04-06 15:41:42
阅读次数:
135
Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co...
分类:
其他好文 时间:
2015-04-06 15:29:43
阅读次数:
123