A Piece of Sunshine


檐下窗欞斜映枝椏 與你席地對座飲茶

Classical Programming Problem - Bitwise Operation / 经典编程问题 - 位运算

1.判断奇偶 只要根据最未位是0还是1来决定,为0就是偶数,为1就是奇数。因此可以用if ((a & 1) == 0)代替if (a % 2 == 0)来判断a是不是偶数。 下面程序将输出0到100之间的所有奇数。 for (i = 0; i < 100; ++i) ...

Classical Programming Problem - Tree / 经典编程问题 - 树

Baisc Tree Structure / 基本的树结构 public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(in...

Classical Programming Problem - Linked List / 经典编程问题 - 链表

Baisc Singly Linked List / 基本的单链表 public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; ...

Algorithm(1)-Greedy Algorithm / 算法(1)-贪心算法

**------English (英文)------**

Sorting / 排序算法

**------English (英文)------** This article summarized the famous sorting algorithms, including insertion sort Insertion sort - O(N) / O(N^2) [B...

Max Subsequence Sum Problem / 最大子序列和问题

**------English (英文)------** Given (possibly negative) integers a1, a2, …, an, find the maximum value of ∑ ak. The maximum subsequence sum is defi...

Cordova-Android Plugin Example / Cordova-Android 插件详解

**------English (英文)------** This is sample cordova plugin (currently for android platform only). Tested with Cordova 5.3.3 + Android 5.1.1 You c...

A Good Site for Coding Test / Codility, 练习编码的好平台

**------English (英文)------** Thanks to an interview opportunity from SurveyMonkey, I learnt this website: Codility, similar to LeetCode. It is an ...