自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

基础不牢,地动山摇!

  • 博客(55)
  • 资源 (39)
  • 收藏
  • 关注

原创 LeetCode206:Reverse Linked List

Reverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?使用迭代和递归实现单链表的反转。迭代的方法之间在剑指offer上面

2015-07-30 11:22:27 2099

原创 LeetCode222:Count Complete Tree Nodes

Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, except possibly the last, is completely fille

2015-07-29 17:17:00 1428

原创 LeetCode229:Majority Element II

Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.借助于Majority Element中的Boyer Moore算法,可以在O(1)的

2015-07-29 15:13:11 1500

原创 LeetCode230:Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the

2015-07-29 11:16:55 653

原创 LeetCode231:Power of Two

Given an integer, write a function to determine if it is a power of two.Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases.这道题有好多种解法。

2015-07-29 10:14:21 925 1

转载 赫夫曼(Huffman树

转载自:http://blog.163.com/zhoumhan_0351/blog/static/3995422720098275836215/一、基本概念1、赫夫曼(Huffman)树又称最优二叉树或最优搜索树,是一种带权路径长度最短的二叉树。在许多应用中,常常赋给树中结点一个有某种意义的实数,称此实数为该结点的权。从树根结点到该结点之间的路径长度与该结点上权的乘积称为结点的带

2015-07-28 10:38:33 694

转载 四叉树与八叉树

转载自:http://blog.csdn.net/zhanxinhang/article/details/6706217前序四叉树或四元树也被称为Q树(Q-Tree)。四叉树广泛应用于图像处理、空间数据索引、2D中的快速碰撞检测、存储稀疏数据等,而八叉树(Octree)主要应用于3D图形处理。对游戏编程,这会很有用。本文着重于对四叉树与八叉树的原理与结构的介绍,帮助您在脑海中建

2015-07-28 10:07:02 867

原创 LeetCode236: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 lowest common ancestor is defined between two node

2015-07-27 15:57:21 612

原创 LeetCode234:Palindrome Linked List

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?给定一个单链表,判断它的元素是否是回文。要求在O(n)的时间复杂度和O(1)的空间复杂度内求解。如果没有时间复杂度的限制,可以直接将链表反转再比较就

2015-07-27 15:47:28 918

原创 LeetCode235: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 to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw

2015-07-24 16:18:04 663

原创 LeetCode203:Remove Linked List Elements

Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5Credits:Special thanks

2015-07-24 15:46:17 1823

原创 LeetCode237: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 list is 1 -> 2 -> 3 -> 4 and you are given the third node with val

2015-07-24 15:22:47 722

原创 LeetCode227:Basic Calculator II

Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should trunca

2015-07-20 16:48:00 942

原创 LeetCode11:Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin

2015-07-20 16:46:46 1350

原创 LeetCode42:Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]

2015-07-20 16:22:02 706

原创 LeetCode238:Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements ofnums except nums[i].Solve it without division and in O(

2015-07-20 15:56:13 1200

原创 LeetCode224:Basic Calculator

Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty space

2015-07-15 16:04:08 906 1

原创 LeetCode173:Binary Search Tree Iterator

Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next() and hasN

2015-07-14 16:14:09 653

原创 最大堆及其操作函数

前几天在做Kth Largest Element in an Array 时使用到了堆,通过那倒题目也了解到了堆的make_heap,push_heap,pop_heap操作,看了C++ reference中的讲解也明白了heap_sort是什么回事。于是想着自己实现以下这四个函数。 堆的定义:任意节点小于它的所有后裔,最小元在堆的根上(堆序性)。堆总是一棵完全树。#include <ios

2015-07-14 15:44:25 1225

原创 LeetCode145:Binary Tree Postorder Traversal

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: Recursive solution is trivial, could you do it iteratively?二叉

2015-07-14 11:21:42 685

原创 LeetCode144:Binary Tree Preorder Traversal

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 solution is trivial, could you do it iteratively?先序遍

2015-07-14 10:29:27 623

原创 LeetCode94:Binary Tree Inorder Traversal

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 solution is trivial, could you do it iteratively?二叉树的

2015-07-14 09:56:27 679

转载 二叉树前序遍历非递归写法

转载自:http://blog.csdn.net/zhangxiangdavaid/article/details/37115355前言在前两篇文章二叉树和二叉搜索树中已经涉及到了二叉树的三种遍历。递归写法,只要理解思想,几行代码。可是非递归写法却很不容易。这里特地总结下,透彻解析它们的非递归写法。其中,中序遍历的非递归写法最简单,后序遍历最难。我们的讨论基础是这样的:

2015-07-14 09:36:52 1264

原创 LeetCode49:Anagrams

Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case.这道题是题目都没读懂,不知道Anagrams什么意思。Anagrams的意思是那些字符串的组成字符相同。比如说abc,那么abc这三个字符的所有排列都是Anagr

2015-07-14 09:10:45 700

转载 关于C++内存中字节对齐问题的详细介绍

转载自:http://m.jb51.net/article/36903.htm本篇文章是对C++内存中字节对齐的问题进行了详细的分析与总结。需要的朋友参考下一、什么是字节对齐计算机中内存空间都是按照byte划分的,从理论上讲似乎对任何类型的变量的访问可以从任何地址开始,但实际情况是在访问特定类型变量的时候经常在特定的内存地址访问,这就需要各种类型数据按照一定

2015-07-13 22:52:50 574

原创 LeetCode3: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. For “

2015-07-13 00:24:28 1019

原创 LeetCode20:Valid Parentheses

Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are all valid

2015-07-11 00:02:15 931

原创 LeetCode155:Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack.pop() – Removes the element on top of the stack.top() – Get the t

2015-07-10 23:32:51 798

原创 LeetCode232:Implement Queue using Stacks

Implement the following operations of a queue using stacks.push(x) – Push element x to the back of queue.pop() – Removes the element from in front of queue.peek() – Get the front element.empty() –

2015-07-10 23:08:22 1153

原创 LeetCode225:Implement Stack using Queues

Implement the following operations of a stack using queues.push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top() – Get the top element. empty() – Return whether

2015-07-10 22:46:38 1427

原创 LeetCode215:Kth Largest Element in an Array

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 example, Given [3,2,1,5,6,4] and k = 2, return 5.Note:

2015-07-09 21:36:41 2364

原创 LeetCode169: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 assume that the array is non-empty and the majority element always

2015-07-09 19:29:49 2828 1

原创 LeetCode93:Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given “25525511135”, return [“255.255.11.135”, “255.255.111.35”]. (O

2015-07-08 15:50:36 2555 1

原创 LeetCode90:Subsets II

Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate

2015-07-08 11:12:56 1741

原创 LeetCode60:Permutation Sequence

The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3):1 “123” 2 “132” 3 “213”

2015-07-08 10:45:24 943

原创 LeetCode131:Palindrome Partitioning

Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = “aab”, Return [

2015-07-07 17:51:57 2333

原创 LeetCode52:N-Queens II

Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 和N-Queens 同样的解法。class Solution {public: int totalNQueens(int n

2015-07-07 17:02:46 845

原创 LeetCode17:Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string “2

2015-07-07 16:50:00 900

原创 LeetCode89:Gray Code

The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray

2015-07-07 15:59:59 2923

转载 Catalan数计算及应用

转载自:http://blog.csdn.net/wuzhekai1985/article/details/6764858问题描述:卡塔兰数,是组合数学中一个常出现在各种计数问题中出现的数列。输入一个整数n,计算h(n)。其递归式如下:h(n)= h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)h(0) (其中n>=2,h(0) = h(1) = 1)

2015-07-07 14:21:04 611

聊天室工程文件

基于完成端口实现的聊天室程序的工程文件,实现多个客户端之间的通讯。

2015-09-04

聊天室可执行程序

使用完成端口模型实现的聊天室可执行文件。可以支持多个客户端连接并通信。

2015-09-04

socket工程文件完成端口版本

socket通信的客户端和服务器端的工程程序,基于完成端口技术,实现了多个客户端向服务器端持续发送数据

2015-09-03

socket通信可执行程序完成端口版本

socket通信的客户端和服务器端的可执行程序,基于完成端口技术,实现了多个客户端向服务器端持续发送数据

2015-09-03

socket工程文件重叠IO完成例程

socket通信的客户端和服务器端的工程文件,基于重叠IO完成例程技术,实现了多个客户端向服务器端持续发送数据

2015-09-03

socket工程文件阻塞版本

socket通信的客户端和服务器端的工程文件,这个是阻塞的版本,实现了客户端向服务器端持续发送数据,但是只能一个客户端发送。

2015-09-01

socket通信

socket通信的客户端和服务器端的可执行程序,这个是阻塞的版本,实现了客户端向服务器端持续发送数据,但是只能一个客户端发送。

2015-09-01

socket通信基本版本

socket通信的客户端和服务器端的工程文件,这个是最基本的版本,实现了客户端向服务器端发送一次数据,然后接收数据再断开连接。

2015-09-01

socket可执行程序

socket通信的客户端和服务器端的可执行程序,这个是最基本的版本,实现了客户端向服务器端发送一次数据,然后接收数据再断开连接。

2015-09-01

FilesRenameSource.rar

对文件进行批量更改后缀名的工具,使用MFC进行开发,源代码

2015-08-21

FileRename.rar

对文件进行批量更改后缀名的工具,使用MFC进行开发

2015-08-21

AddContacts

批量添加联系人,对于有很多联系人需要添加时会很有用

2015-08-18

WordFrequency源码

词频统计的程序,可以根据url查询该网页中出现次数最多的前N个单词。

2015-08-18

WordFrequency

词频统计的可执行程序。可以统计一个网页中出现次数最多的前N个单词

2015-08-18

四则运算C++实现

使用逆波兰式的方式进行表达式求值。在控制台下可进行多组数据的输入处理。

2015-08-13

matrixModelView_mac.zip

模式视图变换的测试程序,可以通过在界面上调整参数直接预览结果

2015-07-28

matrixProjection

投影变换的例子,可以通过在界面上调整参数直接预览结果。

2015-07-28

matrixModelView.zip

模式视图变换的测试代码,可以在界面上调整参数预览结果。

2015-07-28

vim教程.pdf

vim中自带的教程,将它制作成了pdf格式,方便查看

2015-01-28

计算机图形学算法

计算机图形学课程中的算法实现,包括二维和三维图形中平移,旋转,缩放的实现,DDA,中点画线法,Bressenhanm算法绘制直线,多边形扫描算法和种子扫描线算法绘制多边形,还有一个使用opengl实现漫游的程序。

2014-09-05

TestCameraEye.rar

osg中获取漫游器操作场景时任一时刻相机的位置。博客地址:http://blog.csdn.net/u012501459/article/details/36895495

2014-07-04

GenerateBMP.rar

根据给定像素点的RGB值生成bmp位图。博客地址:http://blog.csdn.net/u012501459/article/details/36699735

2014-07-03

PixelColor.rar

读取图片中所有像素处的RGB值,输出到文件中。博客地址:http://blog.csdn.net/u012501459/article/details/36698033

2014-07-03

TestPng.rar

osg使用png或gif格式的图片实现透明效果。博客地址:http://blog.csdn.net/u012501459/article/details/36695977

2014-07-03

TestCone.rar

osg中圆锥的使用,包括一些参数设置。博客地址:http://blog.csdn.net/u012501459/article/details/36672487

2014-07-03

TestCamera

osg中相机参数设置无效的解决办法,原文博客地址:http://blog.csdn.net/u012501459/article/details/36666305

2014-07-03

MFCCompositeViewer.rar

MFC中使用多窗口的例子。OSG自带的例子有使用MFC的,也有使用多窗口的,但是将两者简单结合在一起会出现问题,这个是解决了问题的代码。

2014-01-06

log4plus_x64_vs2008.rar

自己编译的64位的可以在VisualStudio 2008中使用的log4cplus的bin,lib,include文件。

2013-12-31

log4cplus_x86_vs2008.rar

自己编译的32位的可以在VisualStudio 2008中使用的log4cplus的bin,lib,include文件。

2013-12-31

glaux.h glaux.lib gluax.dll

glaux库的.h,.lib,.dll文件

2013-12-02

重构_改善既有代码的设计

2010版的《重构 改善既有代码的设计》,清晰度还可以。

2013-10-29

实现列表控件控制的属性页

实现列表控件控制的属性页,效果图见http://blog.csdn.net/u012501459/article/details/12994013

2013-10-24

socket工程文件重叠IO事件通知版本

socket通信的客户端和服务器端的工程文件,基于重叠IO事件通知技术,实现了多个客户端向服务器端持续发送数据

2015-09-02

socket通信可执行程序重叠IO事件通知版本

socket通信的客户端和服务器端的可执行程序,基于重叠IO事件通知技术,实现了多个客户端向服务器端持续发送数据

2015-09-02

socket通信可执行程序select版本

socket通信的客户端和服务器端的可执行程序,基于select的多路复用技术,实现了多个客户端向服务器端持续发送数据

2015-09-01

socket工程文件select版本

socket通信的客户端和服务器端的可执行程序,基于select的多路复用技术,实现了多个客户端向服务器端持续发送数据

2015-09-01

socket工程文件多线程版本

socket通信的客户端和服务器端的工程文件,这个是多线程版本的,实现了多个客户端向服务器端持续发送数据

2015-09-01

socket多线程版本

socket通信的客户端和服务器端的可执行程序,这个是多线程版本的,实现了多个客户端向服务器端持续发送数据

2015-09-01

空空如也

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

TA关注的人

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