自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Talk is cheap,show me the code!

一个踽踽独行苦逼孩子的呻吟

  • 博客(81)
  • 收藏
  • 关注

原创 CSAPP 实验一lab1 fitsBits

/** fitsBits - return 1 if x can be represented as an * n-bit, two's complement integer.* 1 <= n <= 32* Examples: fitsBits(5,3) = 0, fitsBits(-4,3) = 1* Legal ops: ! ~ & ^ | + << >>* Max

2015-05-31 15:28:07 4454

转载 配置mpich2运行环境

原文地址  http://linux.chinaunix.net/techdoc/net/2008/12/17/1053626.shtml前段时间帮同学在linux下配了一个集群环境,参考了一些网上的文章,就把过程写出来,做个参考吧。其实在我们的环境下ssh已经是配置好的,但是我还是把网上看到的写下来,而且这个配置过程我试过,没有什么问题。创建SSH信任连接 1、更改/et

2015-05-05 14:39:26 1402

原创 C++重载二维数组下标 [ ][ ]

C++重载二维数组下标 [][]一维数组的重载比较简单,直接参数传入下标值,然后返回指针对应的数值。但是如果是重载二维应该下标[][]应当如何解决?比如我们有 Array2 a(3, 4); int i, j; for (i = 0; i < 3; ++i) for (j = 0; j < 4; j++) a[i][j] = i * 4

2015-04-07 17:31:28 3873 1

原创 Sum Root to Leaf Numbers

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find the total

2015-01-08 16:42:52 495

原创 Binary Tree Level Order Traversal II

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,#,#,15,7},

2015-01-08 10:56:26 361

原创 Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20

2015-01-08 10:40:25 380

原创 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 the farthest leaf node./** * Definition for binary tree

2015-01-07 16:57:06 454

原创 Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node./** * Definition for binary tree

2015-01-07 16:54:15 505

原创 Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum

2015-01-07 16:26:34 447

原创 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 and the nodes have the same value./** * Def

2015-01-07 15:56:23 400

原创 Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f

2015-01-07 15:41:44 417

原创 DTD简介入门

DTD是什么DTD-Document Type Definition,中文翻译即文档类型定义,可定义合法的XML文档构建模块。它使用一系列合法的元素来定义文档的结构。如何使用DTD内部声明DTDDTD可以直接包含于XML源文件中,使用方法如下> 一个简单的例子如下<!DOCTYPE note [ ]> George John

2014-12-28 17:42:33 932

原创 PHP实现分页

<?php header("Content-type:text/html;charset=utf-8"); $page=isset($_GET['page'])?intval($_GET['page']):1; //这句就是获取page=18中的page的值,假如不存在page,那么页数就是1。 $num=10; //每页显示10条数据

2014-12-17 15:55:25 556

原创 leetcode 之Merge Sorted Array

Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements fro

2014-12-14 16:37:42 436

原创 leetcode 之Unique Paths II

Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the

2014-12-12 23:09:50 405

原创 leetcode 之Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the

2014-12-12 22:43:34 443

原创 leetcode 之Work Search

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically

2014-12-12 11:04:20 812

原创 leetcode 之Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

2014-12-05 16:42:05 433

原创 leetcode 之Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using e

2014-12-03 21:44:49 519

原创 leetcode 之Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe

2014-12-03 20:54:20 591

原创 PHP 上传文件大小限制

在使用CI框架实现文件的上传时,发现大于8M的文件就会提示出错,此时需要更改php.ini 中的相关设置。1.file_uploads = On ;打开文件上传选项  这个默认是打开的 2.upload_max_filesize = 8M ;上传文件上限 默认是8M,可根据需要更改,但需要注意的是这个是有一定限制的,如32位机最大不能超过INT_MAX大小。3.post_m

2014-12-01 12:15:01 618

原创 cURL使用之利用WeatherWebService获取天气预报

1.cURL是什么cURL是一个利用URL规则在命令行下工作的文件传输工具。2.WeatherWebService简介天气预报 Web 服务,数据每2.5小时左右自动更新一次,准确可靠。包括 340 多个中国主要城市和 60 多个国外主要城市三日内的天气预报数据。网址为  http://www.webxml.com.cn/WebServices/WeatherWebServic

2014-11-26 21:32:59 1825

原创 leetcode 之 String to Integer (atoi)

注意特殊情况的处理:1.字符串qishi有空格,

2014-11-17 16:04:21 440

原创 直接插入排序和shell排序

1.插入排序template void InsertSort(Record a[],int n){ for(int i=1;i<n;i++) //1 { Record temp=a[i]; //2 int j=i-1; whil

2014-11-15 15:04:43 482

原创 malloc/free 与new/delete 的区别

相同点:都能完成在堆内存上完成内存分配的

2014-10-28 15:49:12 471

原创 leetcode 之Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [

2014-10-27 22:28:34 535

原创 包含选择器和子选择器的区别

包含选择器,即加入空格,用于选择指定标签元素下的后辈元素。请注意这个选择器与子选择器的区别,子选择器(child selector)仅是指它的直接后代,或者你可以理解为作用于子元素的第一代后代。而后代选择器是作用于所有子后代元素。后代选择器通过空格来进行选择,而子选择器是通过“>”进行选择。总结:>作用于元素的第一代后代,空格作用于元素的所有后代。.food li{

2014-10-23 15:37:33 2236

原创 类选择器和ID选择器的区别

相同点:它们都可以用于任何元素不同点:1

2014-10-21 16:23:44 1038

原创 (具名)返回值优化 和 复制省略

1.以下代码共调用多少次拷贝构造函数: Widget f(Widget u) {      Widget v(u);      Widget w = v;      return w; } main() {      Widget x;      Widget y = f(f(x)); } A 1  B 3  C 5  D 7

2014-10-16 15:00:22 939 1

原创 《剑指offer》面试题8 旋转数组的最小数字

题目描述:把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。输入:输入可能包含多个测试样例,对于每个测试案例,输入的第一行为一个整数n(1输入的第二行包括n个整数,其中每个整数a的范围是(1输出:对应每个

2014-10-10 21:47:32 557

原创 《剑指offer》面试题6 重建二叉树

#include using namespace std;typedef struct Binary_Node{ int value; struct Binary_Node *left; struct Binary_Node *right;}BinaryNode;int pre_order[1010];int in_order[1010];int flag;

2014-10-09 22:09:06 449

原创 PHP中的cookie与session

1cookie简介Cookie是存储在客户端浏览器中的数据,我们通过Cookie来跟踪与存储用户数据。一般情况下,Cookie通过HTTP headers从服务端返回到客户端。多数web程序都支持Cookie的操作,因为Cookie是存在于HTTP的标头之中,所以必须在其他信息输出以前进行设置,类似于header函数的使用限制。PHP通过setcookie函数进行Cookie的

2014-09-22 15:36:51 658

原创 php中的单例模式

如果我们将构造函数定义成l

2014-09-19 14:26:59 499

原创 C语言中的柔性数组

在C语言里面,当我们定义一个数组的同时必须给出这个数组的大小,

2014-09-17 21:56:39 568

原创 C语言中continue的理解

今天在酷壳网 学习 《语言的歧义》

2014-09-17 11:08:01 3688

原创 样式表

级联样式表是Cascading Style Sheets的中文翻译,对HTML

2014-09-12 15:16:19 462

原创 2014腾讯校园招聘实习技术类笔试题目

2014-04-21笔试和面试2014、校园实习、笔试、腾讯王奎时间:2014-4-20职位:开发、后台、客户端、前端等城市:上海、合肥、沈阳、长沙、深圳(一)不定项选择题(4分X25)1.  使用深度优先算法遍历下图,遍历的顺序为()A ABCDEFG       B ABDCFEGC ABDECFG       D  ABCDFEG2.  输入序列ABCAB

2014-08-27 14:34:40 1079

原创 HTTP中GET和POST方法异同

GET和POST是HTTP中两种最常用的方法。

2014-08-19 16:14:16 461

原创 Git 学习小结

1什么是GitGit是目前最先进的分布式版本控制系统。

2014-08-16 21:35:00 457

原创 《c++primer》第15章面对对象程序设计习题解答

1.什么是虚成员?

2014-07-05 16:01:14 1939

空空如也

空空如也

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

TA关注的人

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