
Java
文章平均质量分 68
再度飞越
这个作者很懒,什么都没留下…
展开
-
将矩阵中含零的行和列置零
Problem If an element in an MxN matrix is 0, set its entire row and column to 0 Solution public class ZeroRowAndCol{ public static void main(String...strings){ int[][] matrix = new int[原创 2013-05-23 19:47:47 · 960 阅读 · 0 评论 -
输出集合中所有数据项组合
Problem Print all combination of a specified list items. Solution public class Combination{ public static void main(String[] arguments){ int[] list = {1, 2, 3, 4}; int[] prece原创 2013-05-24 06:24:18 · 1518 阅读 · 0 评论 -
全排列
Problem Print all permutations of n distinct elements. Solution class Permutation { public static void main(String[] argument) { int[] list = { 1, 2, 3, 4 }; Permutation.Perm(原创 2013-05-14 17:03:22 · 502 阅读 · 0 评论 -
计算变位词
Problem Calc if two strings are anagrams. For example: hello and elloh are anagrams helo and hello are not anagrams Solution 1. Sort the elements in the lists 2. Compare if two lists are原创 2013-05-14 17:16:35 · 583 阅读 · 0 评论 -
翻转字符串
Problem Check if a string is a rotation of another. For example: Hello and loHel are a rotation pair. Tony and Julia are not a rotation pair. Solution public class RotationOfString{ public原创 2013-05-15 09:17:25 · 644 阅读 · 0 评论 -
字符串中的字符是否都是唯一的,未重复的
Problem Determine if a string has all unique characters. Solution public class UniqueCharInString{ public static void main(String[] arguments){ String[] testCases= {"hello", "wolrd",原创 2013-05-16 10:37:08 · 727 阅读 · 0 评论