码迷,mamicode.com
首页 >  
搜索关键字:simple example    ( 24106个结果
几道算法题
1.Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-...
分类:其他好文   时间:2014-06-02 17:36:53    阅读次数:234
Android学习笔记_JNI_c调用java代码
1、编写native方法(java2c)和非native方法(c2java):package com.example.provider;public class CallbackJava { // C调用java空方法 public void helloFromJava() { ...
分类:移动开发   时间:2014-06-02 16:42:34    阅读次数:413
LeetCode: Unique Binary Search Trees II [096]
【题目】 Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. 1 3 3 2 1 \ / / / \ ...
分类:其他好文   时间:2014-06-01 15:33:45    阅读次数:297
jquery.scrollTo-min.js
jquery.scrollTo-min.js 用户返回顶部及动画到目的地,支持目标值、锚点。 使用方法: 1.引入jQuery 2.$.scrollTo( this.hash || targetValue, time);   example:$.scrollTo( this.hash || 0, 500); jquery.scrollTo-min.js ; (functio...
分类:Web程序   时间:2014-06-01 10:56:16    阅读次数:312
每日算法之二十二:Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space....
分类:其他好文   时间:2014-06-01 10:41:23    阅读次数:242
安卓实训第十天:利用SharedPreferences来实现数据的保存和读取,以及实现手机电话备份,XMLserializer
一、利用SharedPreferences来实现数据的保存和读取: 1、Mainactivity: package com.example.sharedpreferencesdemo; import com.example.sharedpreferencesdemo.util.SharedPreferencesUtil; import android.app.Activity; imp...
分类:移动开发   时间:2014-06-01 09:51:36    阅读次数:331
projecteuler---->problem=9----Special Pythagorean triplet
title: A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for wh...
分类:其他好文   时间:2014-06-01 09:17:53    阅读次数:251
LeetCode: Decode Ways [090]
【题目】 A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded message containing digits, determine the total number of ways to decode it. For example, Given encoded ...
分类:其他好文   时间:2014-06-01 08:59:37    阅读次数:258
LeetCode: Subsets II [091]
【题目】 Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets. For example, If S = [1,2,2], a solution ...
分类:其他好文   时间:2014-06-01 08:51:06    阅读次数:292
【leetcode】Generate Parentheses
题目: 给定整数n,返回n对匹配的小括号字符串数组。 For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()" 分析: 这种问题的模式是:1)问题的解有多个 ,2)每个解都是由多个有效的 ”步骤“ 组成的,3)变更以有解的某个或某些”步骤“ 可...
分类:其他好文   时间:2014-05-31 22:28:45    阅读次数:467
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!