<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[longma8520的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/longma8520</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; longma8520]]></copyright><item><title><![CDATA[[数据结构]字符串匹配——朴素算法]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/77936988</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/77936988</guid><author>longma8520</author><pubDate>Mon, 11 Sep 2017 19:42:24 +0800</pubDate><description><![CDATA[public int index(String a,String b,int pos){
		int i=pos;
		int j=0;
		while(i<a.length()&&j<b.length()){
			if(a.charAt(i)==b.charAt(j)){
				++i;
				++j;
			}else{
				i=i-j+1;
				j=0;
			}
		}]]></description><category></category></item><item><title><![CDATA[Java简单实现进程调度算法 FCFS和SJF]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/72460836</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/72460836</guid><author>longma8520</author><pubDate>Thu, 18 May 2017 11:14:07 +0800</pubDate><description><![CDATA[import java.text.DecimalFormat;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class experiment1 {
	public static void main(String[] args) {
		Scanner in= new Sc]]></description><category></category></item><item><title><![CDATA[[leetcode]219. Contains Duplicate II]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/68485749</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/68485749</guid><author>longma8520</author><pubDate>Thu, 30 Mar 2017 13:14:24 +0800</pubDate><description><![CDATA[Given an array of integers and an integer k,
 find out whether there are two distinct indices i and j in
 the array such that nums[i] = nums[j] and
 the absolute difference
 between i and j is
 a]]></description><category></category></item><item><title><![CDATA[[leetcode]234. Palindrome Linked List]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/68485531</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/68485531</guid><author>longma8520</author><pubDate>Thu, 30 Mar 2017 12:36:08 +0800</pubDate><description><![CDATA[Given a singly linked list, determine if it is a palindrome.
Follow up:
Could you do it in O(n) time and O(1) space?

判断单链表是否为回文链表
此题用栈来做将非常简单，第一次遍历将节点入栈，第二次遍历判断是否为回文
public class Solution {
   ]]></description><category></category></item><item><title><![CDATA[[leetcode]205. Isomorphic Strings]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/68246266</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/68246266</guid><author>longma8520</author><pubDate>Wed, 29 Mar 2017 23:51:01 +0800</pubDate><description><![CDATA[Given two strings s and t, determine if they are isomorphic.

Two strings are isomorphic if the characters in s can be replaced to get t.

All occurrences of a character must be replaced with anot]]></description><category></category></item><item><title><![CDATA[[数据结构]单链表操作 (java)]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/66975735</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/66975735</guid><author>longma8520</author><pubDate>Mon, 27 Mar 2017 20:12:10 +0800</pubDate><description><![CDATA[单链表是一种简单而且常用的数据结构，这里简单总结了关于单链表常用的几种操作。


单链表的节点结构如下：
class ListNode {
     int val;
     ListNode next;
     ListNode(int x) {
         val = x;
         next = null;
     }
}
 
1.链表反置
如：现有链表1->]]></description><category></category></item><item><title><![CDATA[[leetcode]367. Valid Perfect Square]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/66100901</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/66100901</guid><author>longma8520</author><pubDate>Sat, 25 Mar 2017 23:54:58 +0800</pubDate><description><![CDATA[Given a positive integer num, write a function which returns True if num is a perfect square else False.

Note: Do not use any built-in library function such as sqrt.

Example 1:
Input: 16
Return]]></description><category></category></item><item><title><![CDATA[[leetcode]345. Reverse Vowels of a String]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/66094654</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/66094654</guid><author>longma8520</author><pubDate>Sat, 25 Mar 2017 23:46:33 +0800</pubDate><description><![CDATA[Write a function that takes a string as input and reverse only the vowels of a string.

Example 1:
Given s = "hello", return "holle".

Example 2:
Given s = "leetcode", return "leotcede".

Note]]></description><category></category></item><item><title><![CDATA[[leetcode]198. House Robber]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/66036246</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/66036246</guid><author>longma8520</author><pubDate>Sat, 25 Mar 2017 23:01:23 +0800</pubDate><description><![CDATA[You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house]]></description><category></category></item><item><title><![CDATA[[leetcode]235. Lowest Common Ancestor of a Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65955673</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65955673</guid><author>longma8520</author><pubDate>Sat, 25 Mar 2017 21:21:08 +0800</pubDate><description><![CDATA[Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.

According to the definition of LCA on Wikipedia: “The lowest common ancestor
 is defined betw]]></description><category></category></item><item><title><![CDATA[[leetcode]21.Merge Two Sorted Lists]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65947709</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65947709</guid><author>longma8520</author><pubDate>Sat, 25 Mar 2017 20:43:17 +0800</pubDate><description><![CDATA[Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
连接两个有序链表，链接后依然有序。
遍历两个链表，依次讲较小节点加入新的链表当中。
/**
 * Defini]]></description><category></category></item><item><title><![CDATA[[leetcode]107. Binary Tree Level Order Traversal II]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65937441</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65937441</guid><author>longma8520</author><pubDate>Sat, 25 Mar 2017 16:08:59 +0800</pubDate><description><![CDATA[Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).

For example:
Given binary tree [3,9,20,null,null,1]]></description><category></category></item><item><title><![CDATA[[leetcode]53. Maximum Subarray]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65629795</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65629795</guid><author>longma8520</author><pubDate>Fri, 24 Mar 2017 13:29:17 +0800</pubDate><description><![CDATA[Find the contiguous subarray within an array (containing at least one number) which has the largest sum.

For example, given the array [-2,1,-3,4,-1,2,1,-5,4],

the contiguous subarray [4,-1,2,1]]]></description><category></category></item><item><title><![CDATA[[leetcode]83. Remove Duplicates from Sorted List]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65482117</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65482117</guid><author>longma8520</author><pubDate>Thu, 23 Mar 2017 23:41:13 +0800</pubDate><description><![CDATA[Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2,
 return 1->2.


Given 1->1->2->3->3, return 1->2->3.




删除重复的节点

一开]]></description><category></category></item><item><title><![CDATA[[leetcode]121. Best Time to Buy and Sell Stock]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65444624</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65444624</guid><author>longma8520</author><pubDate>Thu, 23 Mar 2017 15:51:09 +0800</pubDate><description><![CDATA[Say you have an array for which the ith element is the price of a given stock on day i.

If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),]]></description><category></category></item><item><title><![CDATA[[leetcode]405. Convert a Number to Hexadecimal]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65443832</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65443832</guid><author>longma8520</author><pubDate>Thu, 23 Mar 2017 14:59:25 +0800</pubDate><description><![CDATA[Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s
 complement method is used.

Note:

All letters in hexadecimal (a-f) must be in lowercase.The hexade]]></description><category></category></item><item><title><![CDATA[[leetcode]108. Convert Sorted Array to Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65443059</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65443059</guid><author>longma8520</author><pubDate>Thu, 23 Mar 2017 14:07:48 +0800</pubDate><description><![CDATA[Given an array where elements are sorted in ascending order, convert it to a height balanced BST.


每次递归取数组的中间值作为根节点，则左子树的根为(left,mid-1)/2对应的值，右子树根为(mid+1,right)/2
/**
 * Definition for a binary t]]></description><category></category></item><item><title><![CDATA[[leetcode]415. Add Strings]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65442068</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65442068</guid><author>longma8520</author><pubDate>Thu, 23 Mar 2017 12:21:32 +0800</pubDate><description><![CDATA[Given two non-negative integers num1 and num2 represented
 as string, return the sum of num1 and num2.

Note:

The length of both num1 and num2 is
 Both num1 and num2 contains
 only digits 0-9.]]></description><category></category></item><item><title><![CDATA[[leetcode]286. Missing Number]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/65032631</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/65032631</guid><author>longma8520</author><pubDate>Wed, 22 Mar 2017 23:00:55 +0800</pubDate><description><![CDATA[Given an array containing n distinct numbers taken from 0, 1, 2, ..., n,
 find the one that is missing from the array.

For example,
Given nums = [0, 1, 3] return 2.

Note:

Your algorithm sho]]></description><category></category></item><item><title><![CDATA[[Unity]2D打飞机游戏]]></title><link>https://blog.youkuaiyun.com/longma8520/article/details/52846988</link><guid>https://blog.youkuaiyun.com/longma8520/article/details/52846988</guid><author>longma8520</author><pubDate>Tue, 18 Oct 2016 10:58:22 +0800</pubDate><description><![CDATA[今天带来一个在自学Unity3D过程中写的第一个2D打飞机小游戏。代码写得不好，功能也很少，主要是为了记录学习心得，也希望各位能够多给些指导。后续应该会有优化和完善游戏功能。


闲话不多说，先来分析下游戏:
几乎没有什么功能，没有UI。主要有玩家方向键控制飞机移动，空格键射击，敌人被击中后销毁。


1.创建工作层
为了使游戏对象在场景中的层次不会错乱，可以创建不同的工作层来管理]]></description><category></category></item></channel></rss>