原创 安卓文件讀取

private void viewfile(String path) { StringBuffer buff = new StringBuffer(); BufferedReader reader; String st

原创 Android學習一——動態添加組件與刪除,可見性設置,imagebutton簡單使用

一、動態添加組件 在佈局爲水平線性佈局的情況下,添加的佈局會直接加在後面,這裏只是簡單介紹添加布局的方法取到上下文,取到要添加組件的佈局,new一個要添加的組件,設置組件相關屬性,添加組件。 // 動態添加textview mcontex

原创 leetcode 6. ZigZag Conversion

題目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to di

原创 算法概論課後8.9

題目: 給定一組集合{S1,S2,S3,…,Sn}和預算b,求一個集合H,其中H和所有Si相交且H的規模不超過b,前提是這個集合存在。求證該問題是NP完全問題  證明 假設有一個圖G(V,E),則把該圖的每一條邊對應一個集合Si,邊上的兩

原创 算法:LeetCode240

題目 Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:

原创 leetcode 96. Unique Binary Search Trees

1.題目 Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n =

原创 leetcode322. Coin Change

題目 You are given coins of different denominations and a total amount of money amount. Write a function to compute the f

原创 leetcode523. Continuous Subarray Sum

題目 Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous

原创 leetcode 3. Longest Substring Without Repeating Characters

題目 Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb",

原创 leetcode 151. Reverse Words in a String

1.題目 Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is

原创 算法:LeetCode5. Longest Palindromic Substring

題目 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.