自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 收藏
  • 关注

原创 Coursera-ML:Week1-Octave/Matlab Tutorial

简单的Matlab命令基本的矩阵向量操作、数据的保存

2016-12-25 17:28:56 906

原创 LeetCode-231 Power of Two

https://leetcode.com/problems/power-of-two/Given an integer, write a function to determine if it is a power of two.以下几种方法均(8ms)1、可以发现2的幂只有最高位是1,故n&(n-1)== 0class Solution {public:    b

2016-06-20 00:37:52 496

原创 LeetCode-326 Power of Three

https://leetcode.com/problems/power-of-three/Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?1、一直整除

2016-06-20 00:03:47 408

原创 LeetCode-191 Number of 1 Bits

https://leetcode.com/problems/number-of-1-bits/Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the

2016-06-19 23:36:17 412

原创 LeetCode-235 Lowest Common Ancestor of a Binary Search Tree

https://leetcode.com/problems/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.According

2016-06-19 23:30:28 326

原创 LeetCode-13 Roman to Integer

https://leetcode.com/problems/roman-to-integer/Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.1、罗马数字表示方法:罗马数字采用七个罗马字母作数字、

2016-06-18 12:26:43 298

原创 LeetCode-206 Reverse Linked List

https://leetcode.com/problems/reverse-linked-list/Reverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?1、非递归,头插法实

2016-06-18 11:35:13 357

原创 LeetCode-350 Intersection of Two Arrays II

https://leetcode.com/problems/intersection-of-two-arrays-ii/Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return

2016-06-18 10:58:08 282

原创 LeetCode-217 Contains Duplicate

https://leetcode.com/problems/contains-duplicate/Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the

2016-06-17 17:48:05 336

原创 leetCode-169 Majority Element

https://leetcode.com/problems/majority-element/Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assum

2016-06-17 11:48:03 284

原创 LeetCode-242 Valid Anagram

https://leetcode.com/problems/valid-anagram/Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "

2016-06-17 11:21:12 298

原创 LeetCode-168 Excel Sheet Column Title

Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB class

2016-06-16 18:44:41 343

原创 LeetCode-171 Excel Sheet Column Number

https://leetcode.com/problems/excel-sheet-column-number/Given a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -

2016-06-16 17:06:23 452

原创 LeetCode-100 Same Tree

https://leetcode.com/problems/same-tree/Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an

2016-06-16 16:21:26 353

原创 LeetCode-237 Delete Node in a Linked List

https://leetcode.com/problems/delete-node-in-a-linked-list/Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked l

2016-06-14 23:56:53 402

原创 LeetCode-283 Move Zeroes

https://leetcode.com/problems/move-zeroes/Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example

2016-06-14 23:38:10 347

原创 LeetCode-349 Intersection of Two Arrays

https://leetcode.com/problems/intersection-of-two-arrays/Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]

2016-06-14 22:58:36 360

原创 LeetCode-226 Invert Binary Tree

https://leetcode.com/problems/invert-binary-tree/Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1/** * De

2016-06-13 22:53:01 435

原创 LeetCode-104 Maximum Depth of Binary Tree

https://leetcode.com/problems/maximum-depth-of-binary-tree/Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to

2016-06-13 22:43:41 296

原创 LeetCode-258 Add Digits

https://leetcode.com/problems/add-digits/Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is

2016-06-13 22:13:05 401

原创 LeetCode-292 Nim Game

https://leetcode.com/problems/nim-game/You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. T

2016-06-13 21:36:14 324

原创 LeetCode-344 Reverse String

https://leetcode.com/problems/reverse-string/Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".1、第一反应...for循环逆

2016-06-06 22:19:53 387

原创 LeetCode-1 Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Given nums =

2016-06-03 23:46:53 307

原创 Windows+Eclipse+Python+Beautifulsoup配置问题

1、Python安装模块出错(ImportError: No module named setuptools)解决方法Windows环境下Python默认是没有安装setuptools这个模块,下载安装的脚本https://bootstrap.pypa.io/ez_setup.py,下载该脚本后运行python ez_setup.py2、从http://www.crummy.c

2016-04-13 10:05:39 1114

转载 poj刷题进度指南

初期:一.基本算法:       (1)枚举. (poj1753,poj2965)     (2)贪心(poj1328,poj2109,poj2586)     (3)递归和分治法.       (4)递推.       (5)构造法.(poj3295)     (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)

2016-03-13 15:46:43 557

原创 Eclipse创建Android Application时出现的一些问题

1、API版本选择的问题:新建Android Application后,activity_main.xml无法显示,报错如上所示,按照http://jingyan.baidu.com/article/bea41d439bd6d5b4c41be659.html里面的重新添加了资源库以后,发现还需将API调至22以下才可以,如下调至18后可以显示xml.

2015-12-06 18:37:08 1297

原创 《汇编语言(王爽)》第七、八章【总结】

第七章 更灵活的定位内存地址的方法1、and和or指令:and指令:可以将操作对象相应位设为0,其他位不变;or指令:可以将操作对象相应位设为1,其他位不变;2、ASCII码:3、以字符形式给出的数据:'......'指明数据是以字符形式给出的,编译器将它们转化成对应的ASCII码大写字母——>ASCII码的第5位为0;(小写字母对应为1)

2015-10-29 14:42:35 683

原创 《汇编语言(王爽)》第五章([bx]和loop指令)、第六章(包含多个段的程序)【总结】

一、第五章 [bx]和loop指令1、(ax)表示ax中的内容"()"中的元素可以为寄存器名、段寄存器名、内存单元的物理地址(20位)"(X)"表示数据可以是字节型、字型mov ax,[bx];(ax)=((ds)*16+(bx))mov [bx],ax;((ds)*16+(bx)=(ax)2、idata表示常量3、loop指令:CPU执行l

2015-10-23 14:35:43 801

原创 《汇编语言(王爽)》第四章——第一个程序【总结】

1、可执行文件 = 程序(机器码) + 数据(源程序中定义的数据) + 相关的描述信息2、源程序(汇编指令、伪指令、标号)assume cs:codesgcodesg segmentstart:mov ax,0123H...mov ax,4c00Hint 21Hcodesg endsend程序是源程序中最终由计算机执行处理的指令或数据

2015-10-20 21:58:01 1145

原创 《汇编语言(王爽)》第三章——寄存器(内存访问)【总结】

1、内存中字的存储字单元:存放一个字型数据(16位)的内存单元,由两个地址连续的内存单元组成,高位字节存放在高位地址单元。N+1号单元和N号单元:地址为N的字单元的高位字节单元、低位字节单元。2、DS和[address]DS:存放要访问的数据段的地址[address]:一个内存单元,address表示内存单元的偏移地址8086CPU不支持将数

2015-10-20 21:53:51 1089 1

原创 《汇编语言(王爽)》第二章——寄存器(CPU工作原理)【总结】

8086 CPU有14个寄存器(均为16位):AX,BX,CX,DX,SI,DI,SP,BP,IP,CS,SS,DS,ES,PSW1、通用寄存器:AX、BX、CX、DX16位,可存储的数据的最大值为2^16-1每个寄存器可分为两个独立使用的8位寄存器,eg. AX可分为AH、AL2、字在寄存器中的存储:8086中一个字=2B(高位字节、低位字节)

2015-10-09 17:06:37 790

原创 《汇编语言(王爽)》第一章——基础知识【总结】

1、机器语言:机器指令的集合;二进制代码;每种微处理器都有自己的机器指令集(或汇编指令集)2、汇编语言:组成:汇编指令(与机器指令一一对应)、伪指令、其他符号汇编指令——编译器——>机器指令3、存储器:CPU可以直接使用的信息在存储器中存放指令和数据在存储器中存放,即内存磁盘上的数据或程序如果不读到内存中就无法被CPU使用4、指令和数据:内存或磁盘上二者均为

2015-10-08 20:12:14 908

转载 《一个操作系统的实现》——pmtest1.asm详解

【操作系统由实模式到保护模式的转换】【保护模式下分段机制的内存寻址】首先在16位代码段,实模式下运行,在实模式下,通过(段寄存器×16+偏移量)得到32位代码的真正物理首地址,并将其放入到段描述符表中,以供在保护模式下使 用,因为保护模式下寻址,是通过段选择子,段描述符表,段描述符一起工作寻址的。所以在实模式下所做的工作就是初始化段描述符表里的所有段描述符。

2015-10-05 15:28:30 1895

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除