随笔分类 -  Algorithm/算法

摘要:date: 2015 09 24 21:09:00 Print Zigzag 思路: 1 首先是按行输出,每行输出相同位置的下一间隔为 ,行游标0 初始化时(每一行的首个斜向部分),j=i,字符位置为span i+(j i),其中j i==0; 也必须这样初始化,因为要打印出首列的字符,通过j=i初 阅读全文
posted @ 2016-07-06 23:34 toto怎么会喝醉 阅读(154) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2016-07-06 23:32 toto怎么会喝醉 阅读(157) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2016-07-06 23:31 toto怎么会喝醉 阅读(194) 评论(0) 推荐(0)
摘要:date: 2015 09 06 19:45:38 Java最基本的数据结构有数组和链表。 数组的特点是空间连续(大小固定)、寻址迅速,但是插入和删除时需要移动元素,所以查询快,增加删除慢。 链表恰好相反,可动态增加或减少空间以适应新增和删除元素,但查找时只能顺着一个个节点查找,所以增加删除快,查找 阅读全文
posted @ 2016-07-06 23:25 toto怎么会喝醉 阅读(162) 评论(0) 推荐(0)
摘要:```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... 阅读全文
posted @ 2015-09-24 18:25 toto怎么会喝醉 阅读(133) 评论(0) 推荐(0)
摘要:来自lknny.com,欢迎交流学习! "点击" tags: [leetcode,algorithm]categories: algorithm Two SumGiven an array of integers, find two numbers such that they add up to... 阅读全文
posted @ 2015-09-13 17:14 toto怎么会喝醉 阅读(142) 评论(0) 推荐(0)
摘要:orangeme404 阅读全文
posted @ 2015-09-08 18:45 toto怎么会喝醉 阅读(152) 评论(0) 推荐(0)