随笔分类 - Algorithm/算法
摘要:date: 2015 09 24 21:09:00 Print Zigzag 思路: 1 首先是按行输出,每行输出相同位置的下一间隔为 ,行游标0 初始化时(每一行的首个斜向部分),j=i,字符位置为span i+(j i),其中j i==0; 也必须这样初始化,因为要打印出首列的字符,通过j=i初
阅读全文
摘要:date: 2015 09 13 16:32:49 Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the
阅读全文
摘要:date: 2015 09 09 20:20:58 Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum
阅读全文
摘要:date: 2015 09 06 19:45:38 Java最基本的数据结构有数组和链表。 数组的特点是空间连续(大小固定)、寻址迅速,但是插入和删除时需要移动元素,所以查询快,增加删除慢。 链表恰好相反,可动态增加或减少空间以适应新增和删除元素,但查找时只能顺着一个个节点查找,所以增加删除快,查找
阅读全文
摘要:```java public static String Convert(String s,int row) { char[] c=s.toCharArray(); int len=s.length(); StringBuilder[] stringBuilders=new StringBuilder[row]; for (int i = 0; i =1; j--) { s...
阅读全文
摘要:来自lknny.com,欢迎交流学习! "点击" tags: [leetcode,algorithm]categories: algorithm Two SumGiven an array of integers, find two numbers such that they add up to...
阅读全文

浙公网安备 33010602011771号