原创 Android自定義控件(二)——圓形進度條以及回調方法

(一)引言 上一篇博客介紹了Android自定義控件中音量控制器的實現方法,沒有看過的盆友可以傳送到http://blog.csdn.net/a253664942/article/details/45017283看看。今天準備給大

原创 leetcode 19:Remove Nth Node From End of List

題目描述 Given a linked list, remove the nth node from the end of list and return its head. For example, Given link

原创 求數組最大子序列的和

題目:給出數組{4,-3,5,-2,-1,2,6,-2},求子序列的最大和。 分別用一下兩種方法解決。 #include <stdio.h> // 方法1: 分治法 //時間複雜度 O(NlogN) int max3(int n

原创 leetcode 283:Move Zeroes

題目描述: Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order o

原创 leetcode 27:Remove Element

Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate

原创 遞歸回溯法實戰(一)——(Red and Black)紅黑磚迷陣(POJ1979)

問題模型 有一個矩形的房間裏鋪滿正方形瓷磚。每塊瓷磚塗成黑色或紅色。一個人站在黑色的瓷磚上,從此出發,可以移動到四個相鄰的瓷磚之一,但只能移動到黑色的瓷磚上。計算他通過重複上述移動所能經過的黑磚數。 示意圖如下(畫的有點醜(⊙﹏

原创 動畫效果第一彈——購物車添加商品特效

(一)引言 以前在餓了麼上面訂餐的時候,曾經看到過這麼一個特效,就是將商品加入訂單時,會有一個小球呈拋物線狀落入購物車中,然後購物車中的數量會改變。具體的效果如下圖。 效果很簡單 ,就是一個拋物線的動畫,那麼我們應該用什麼技術

原创 leetcode 171: Excel Sheet Column Number

Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B ->

原创 leetcode 66: Plus One

Question: Given a non-negative number represented as an array of digits, plus one to the number. The digits are sto

原创 leetcode 290:Word Pattern

題目描述: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such

原创 淺談Android Canvas繪圖類

android中的繪圖類主要涉及Canvas和Paint兩個類。Canvas相當於畫布,而Paint相當於畫筆。有了畫布和畫筆,就可以進行繪圖了。 要繪圖,首先得調整畫筆,待畫筆調整好之後,再將圖像繪製到畫布上,這樣纔可以顯示在

原创 leetcode 205: Isomorphic Strings

題目描述: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in

原创 leetcode 235:Lowest Common Ancestor of a Binary Search Tree

題目描述: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. Accord

原创 Groovy入門(四)——集合Map

Map map聲明方式 def myMap =['a':1,'b':2,'c':3] assert myMap instance HashMap assert myMap.size() == 3 assert myMap['a']

原创 Android 自定義控件玩轉字體變色 打造炫酷ViewPager指示器

1、概述 本篇博客的產生呢,是因爲,羣裏的哥們暖暖給我發了個效果圖,然後問我該如何實現頂部ViewPager指示器的字體變色,該效果圖是這樣的: 大概是今天頭條的app,神奇的地方就在於,切換ViewPager頁面的時候,頂部