自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(49)
  • 资源 (1)
  • 收藏
  • 关注

转载 C++多态的实现原理

用virtual关键字申明的函数叫做虚函数,虚函数肯定是类的成员函数。存在虚函数的类都有一个一维的虚函数表叫做虚表。类的对象有一个指向虚表开始的虚指针。虚表是和类对应的,虚表指针是和对象对应的。多态性是一个接口多种实现,是面向对象的核心。分为类的多态性和函数的多态性。多态用虚函数来实现,结合动态绑定。纯虚函数是虚函数再加上= 0。抽象类是指包括至少一个纯虚函数的类。纯虚函数:virtua

2016-04-18 22:10:17 614

转载 联编-迟后联编-先期联编

原博地址:http://blog.sina.com.cn/s/blog_701d49650100sg8f.html C/C++很有用的基础知识。联编指语言实现过程中合并模块、函数等代码单元生成可执行代码调用的处理过程,通常会明确地确定对每个模块、函数调用的存储器地址,把外部对它们的访问绑定正确的地址上。可以把联编分为两种类型,静态联编和动态联编。前者在编译期就确定了函数调用和函数实现之间的联系,

2016-04-08 20:35:44 1008

转载 栈区,堆区,全局区,文字常量区,程序代码区 详解

原博地址:http://blog.csdn.net/yitian20000/article/details/6358837 感觉这篇文章讲的很清晰,很详细。一、预备知识—程序的内存分配 一个由C/C++编译的程序占用的内存分为以下几个部分 1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其 操作方式类似于数据结构中的栈。 2、堆区

2016-04-08 14:24:21 378

原创 [图像处理]边缘提取以及Harris角点检测

在本周的计算机视觉与模式识别作业中,给定输入图像是两张普通A4打印纸,上面可能有手写笔记或者打印内容但是拍照时角度不正。要求输出: 1. 图像的边缘; 2. 计算 A4纸边缘的各直线方程; 3. 提取A4纸的4个角点。 作业要求的是使用C++的CImg库,与OpenCV和MATLAB相比,CImg还是有点不太方便。图像边缘的提取 这个任务比较简单,找一个像Prewitt算子、拉普拉斯

2016-03-15 15:28:41 8303 1

原创 [LeetCode]213 强盗入屋 II

House Robber II(强盗入屋 II)【难度:Medium】 After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all house

2016-03-13 23:59:18 976

原创 [LeetCode]198 强盗入屋

House Robber(强盗入屋)【难度:Easy】 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

2016-03-13 22:24:35 495

原创 [LeetCode]264 丑数 II

Ugly Number II(丑数 II)Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence

2016-03-13 21:40:35 398

原创 [LeetCode]313 超级丑数

Super Ugly Number(超级丑数)【难度:Medium】 Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For e

2016-03-13 21:30:18 1339

原创 [算法]最大子段和问题

给定长度为n的整数序列,a[1…n], 求[1,n]某个子区间[i , j]使得a[i]+…+a[j]和最大.或者求出最大的这个和.例如(-2,11,-4,13,-5,2)的最大子段和为20,所求子区间为[2,4].解题思路穷举 通过三重循环遍历所有的子段可能,取得最大和时的子段下标,简单但低效,并且当序列范围太大时,可能会超时。int begin = 0;int end = 0;int

2016-03-13 14:56:15 496

原创 [LeetCode]201 区间按位与

Bitwise AND of Numbers Range(区间按位与)【难度:Medium】 Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For example, given the range [5, 7],

2016-03-09 14:30:21 1452

原创 [LeetCode]120 三角矩阵

Triangle(三角矩阵)【难度:Medium】 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

2016-03-09 14:14:50 413

原创 [LeetCode]43 高精度乘法

Multiply Strings(高精度乘法)【难度:Medium】 Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative. 实现高精度非负整

2016-03-07 20:49:47 1568

原创 [LeetCode]2 两个数相加

Add Two Numbers(两个数相加)【难度:Medium】 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the t

2016-03-07 19:36:37 648

原创 [LeetCode]154 有序数组旋转后的最小值 II

Find Minimum in Rotated Sorted Array II(找到有序数组旋转后的最小值 II)【难度:Medium】 Follow up for “Find Minimum in Rotated Sorted Array”: What if duplicates are allowed?Would this affect the run-time complexity? Ho

2016-03-06 15:06:46 361

原创 [LeetCode]153 有序数组旋转后的最小值

Find Minimum in Rotated Sorted Array(找到有序数组旋转后的最小值)【难度:Medium】 Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minim

2016-03-06 15:01:52 537

原创 [LeetCode]274 H指数

H-Index(H指数)【难度:Medium】 Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.According to the definition of h-ind

2016-03-06 14:28:39 484

原创 [LeetCode]28 实现子字符串匹配

Implement strStr() (实现子字符串匹配)【难度:Easy or Medium】 Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 返回在主字符串中出现的第一个子字符串的下标,如果不

2016-03-06 13:58:16 3018

原创 [LeetCode]145 二叉树后序遍历

Binary Tree Postorder Traversal(二叉树后序遍历)【难度:Medium】 Given a binary tree, return the postorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, return [3,2,1].Note: Recursiv

2016-03-05 17:32:33 940

原创 [LeetCode]94 二叉树中序遍历

Binary Tree Inorder Traversal(二叉树中序遍历)【难度:Medium】 Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, return [1,3,2].Note: Recursive so

2016-03-05 17:25:40 1145

原创 [LeetCode]144 二叉树先序遍历

Binary Tree Preorder Traversal(二叉树先序遍历)【难度:Medium】 Given a binary tree, return the preorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, return [1,2,3].Note: Recursive

2016-03-05 17:19:13 1410

原创 [LeetCode]41 第一个缺失的整数

First Missing Positive(第一个缺失的整数)【难度:hard】 Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should

2016-03-05 16:33:24 606

原创 [LeetCode]268 消失的数字

Missing Number(消失的数字)【难度:Medium】 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:

2016-03-05 15:36:12 857

原创 [LeetCode]44 通配符的匹配

Wildcard Matching(通配符的匹配)【难度:Hard】 Implement wildcard pattern matching with support for ‘?’ and ‘*’.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequen

2016-03-05 15:24:23 483

原创 [LeetCode]4 两个有序数组的中位数

Median of Two Sorted Arrays(两个有序数组的中位数)【难度:hard】 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sho

2016-03-05 01:32:24 14788 3

原创 [LeetCode]334 三个递增数字子序列

Increasing Triplet Subsequence(三个递增数字子序列)【难度:Medium】 Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should: Return true

2016-03-04 18:26:53 1218

原创 [LeetCode]215 数组第k大的数

Kth Largest Element in an Array(数组第k大的数)【难度:Medium】 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exa

2016-03-04 00:18:03 15567 1

原创 [编译原理]实现AQL Subset

AQL Subset的实现是我们学校软件工程编译原理课程的期末项目,其目的在于通过实现一个简单的编译器来加深学生对编译原理,如语言和文法、词法分析、语法分析等过程的理解,可以帮助学生深入认识编程的思想,编译器的底层实现。本文用于总结整个项目过程中遇到的难点,以及一点点个人经验。什么是AQL全称:Annotation Query Language用于Text Analytics,可以从非结构化或半

2016-03-03 12:21:17 998

原创 [LeetCode]40 和的组合 II

Combination Sum II(和的组合 II)【难度:Medium】 Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may

2016-03-03 00:07:41 315

原创 [LeetCode]39 和的组合形式

Combination Sum(和的组合形式)【难度:Medium】 Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be

2016-03-02 14:15:31 233

原创 [LeetCode]332 航程重建

Reconstruct Itinerary(航程重建)【难度:Medium】 Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong

2016-03-02 00:34:29 1906

原创 [LeetCode]33 旋转后的有序数组中的搜索

Search in Rotated Sorted Array(旋转后的有序数组中的搜索)【难度:hard or Easy】 Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a

2016-03-01 23:54:32 397

原创 [LeetCode]136 单一的数字

Single Number(单一的数字)【难度:Medium】 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 im

2016-03-01 16:29:46 292

原创 [LeetCode]67 二进制相加

Add Binary(二进制相加)【难度:Easy】 Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.给定两个二进制数的字符串,以字符串形式返回他们的和。 如: a = “11” b = “1” return “10

2016-03-01 16:11:40 307

原创 [LeetCode]16 最接近的三者之和

3Sum Closest(最接近的三者之和)【难度:Medium】 Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume

2016-02-29 22:32:13 367

原创 [LeetCode]15 三者之和

3Sum(三者之和)Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: Elements in a triplet (a,b,c)

2016-02-29 21:32:26 252

原创 [LeetCode]1 两者之和

Two Sum(两者之和)【难度:Easy】 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

2016-02-29 20:37:12 303

原创 [LeetCode]105 根据先序遍历和中序遍历构建二叉树

Construct Binary Tree from Preorder and Inorder Traversal(根据先序遍历和中序遍历构建二叉树)【难度:Medium】 Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates d

2016-02-29 14:32:14 1466

原创 [LeetCode]106 根据中序遍历和后序遍历构建二叉树

Construct Binary Tree from Inorder and Postorder Traversal(根据中序遍历和后序遍历构建二叉树)【难度:Medium】 Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates

2016-02-29 14:23:25 2689 1

原创 [LeetCode]236 二叉树的最近公共父亲节点

Lowest Common Ancestor of a Binary Tree(二叉树的最近公共父亲节点)Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowe

2016-02-28 20:52:17 6791

原创 [LeetCode]235 二叉查找树的最近公共父亲节点

Lowest Common Ancestor of a Binary Search Tree(二叉查找树的最近公共父亲节点)【难度:Easy】 Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definitio

2016-02-28 20:39:10 3131

Unity3D期末

中山大学数字媒体方向孙伟课程期末作业,有点坑

2016-01-28

空空如也

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

TA关注的人

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