C++
文章平均质量分 73
iouiwc
这个作者很懒,什么都没留下…
展开
-
编程艺术::交替字符串 C++语言
题目和分析来自于https://github.com/julycoding/The-Art-Of-Programming-By-July/blob/master/ebook/zh/05.04.md题目描述输入三个字符串s1、s2和s3,判断第三个字符串s3是否由前两个字符串s1和s2交错而成,即不改变s1和s2中各个字符原有的相对顺序,例如当s1 = “aabcc”,s2 =原创 2015-03-15 03:10:39 · 748 阅读 · 0 评论 -
LeetCode[91]::Decode Ways C++
A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total number原创 2015-08-22 22:47:21 · 909 阅读 · 0 评论 -
LeetCode[85]::Maximal Rectangle C++
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.class Solution {public: int maximalRectangle(vector>& matrix) {原创 2015-08-22 20:45:14 · 608 阅读 · 0 评论 -
设计模式:导论和背景知识
http://www.bogotobogo.com/DesignPatterns/introduction.phpDesign PatternsDesign patterns are classified as three groups.Creational PatternsAbstract Factory - Provide an interf转载 2015-05-01 11:32:02 · 1433 阅读 · 0 评论 -
设计模式:行为模式:职责链(chain of responsibility)
Chain of ResponsibilityChain-of-responsibility pattern is a design pattern consisting of a series of processing objects.For example, Filter/ColorMatch/RedEye/Rotator are the processing obj转载 2015-05-01 11:32:03 · 500 阅读 · 0 评论 -
设计模式:结构型模式:适配器(adapter)
http://www.codeproject.com/Tips/595716/Adapter-Design-Pattern-in-CplusplusUsing the CodeAn adapter pattern converts the interface of a class into another interface the clients expect. Adap转载 2015-04-28 21:00:44 · 465 阅读 · 0 评论 -
数据结构:栈 C++
题目来自于http://zhedahht.blog.163.com/blog/#m=0&t=1&c=fks_081075092084086069084074084070080087080066083082非常感谢何海涛,July大神和众网友。本博文初衷是为了方便自己准备面试,有一篇文章可以看所有的东西,省的翻来翻去。代码是手打的Qt C++,解法中不考虑实现最简单的毫无难度原创 2015-04-05 16:40:53 · 831 阅读 · 0 评论 -
数据结构:链表 C++
// 微软100题:09 链表中倒数第k个结点[数据结构]// 题目:输入一个单向链表,输出该链表中倒数第k个结点。链表的倒数第0个结点为链表的尾指针。// 链表结点定义如下:// struct ListNode// {// int m_nKey;// ListNode* m_pNext;// };#include #include #inclu原创 2015-04-04 17:11:58 · 2196 阅读 · 1 评论 -
数据结构:字符串 C++
题目来自于https://github.com/julycoding/The-Art-Of-Programming-By-July/blob/master/ebook/zh/01.00.md非常感谢July大神和众网友。本博文初衷是为了方便自己准备面试,有一篇文章可以看所有的东西,省的翻来翻去。代码是手打的Qt C++,解法中不考虑实现最简单的毫无难度的暴力解法了。因为原创 2015-04-03 16:37:55 · 1378 阅读 · 0 评论 -
LeetCode::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原创 2015-03-12 17:54:26 · 458 阅读 · 0 评论 -
LeetCode::Merge Sorted Array C++语言
问题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 element原创 2015-03-12 15:39:27 · 431 阅读 · 0 评论 -
教你透彻了解红黑树
https://github.com/julycoding/The-Art-Of-Programming-By-July/blob/master/ebook/zh/03.01.md教你透彻了解红黑树二叉查找树由于红黑树本质上就是一棵二叉查找树,所以在了解红黑树之前,咱们先来看下二叉查找树。二叉查找树(Binary Search Tree),也称有序二叉树(ord转载 2015-03-11 19:39:06 · 2776 阅读 · 0 评论 -
设计模式:创建型模式:建造模式(Builder Pattern)
本文是下面文章的剪辑,深表感谢:1)Builder模式的误区:将复杂对象的构建进行封装,就是Builder模式了吗? http://www.cnblogs.com/happyhippy/archive/2010/09/01/1814287.html2)深入浅出设计模式 by AI923)Example of `builder' design pattern in C++ https:原创 2015-03-28 18:24:31 · 770 阅读 · 0 评论 -
四种常见的基于比较的排序算法C++
下面的代码包括了四种常见的排序算法:归并排序(merge sort)快速排序(quick sort)大根堆排序(max root heap sort)和插入排序(insertion sort)#include#define ARRAY_SIZE 15using namespace std;typedef struct _node{ int value_;原创 2015-03-11 04:31:20 · 711 阅读 · 1 评论 -
【整理】关于C/C++语言面试题问答
准备找工作ing,题目不是我自己遇到的,都是网上整理来的,所以标注转载。答案可能自己加工过,尽量保证正确全面,欢迎大家阅读后指正指点指教!只涉及C C++两种语言,数据结构和算法另外单开一贴。第一大类:指针和内存空间Q: 指针和引用的区别A: 1)指针指向第二大类:关键词和宏定义第三大类:类、面向对象原创 2015-03-09 14:36:54 · 526 阅读 · 0 评论 -
设计模式:创建型模式:原型模式(prototype pattern)
本文的内容是综合下面几篇文章,深表感谢:1)http://www.cppblog.com/converse/archive/2006/07/21/10307.html2)http://www.jellythink.com/archives/3783)http://www.jellythink.com/archives/105什么是原型模式:原型模式就是你有一个对象,而且原创 2015-03-27 18:20:32 · 520 阅读 · 0 评论 -
设计模式:创建型模式:工厂模式(factory pattern)
本文基于整理综合下面两文,深表感谢:1)设计模式精解-GoF 23 种设计模式解析附 C++实现源码 http://ccftp.scu.edu.cn:8090/Download/038c70a8-c724-4b86-91c3-74b927b1d492.pdf2)设计模式C++实现(1)---工厂模式 http://blog.csdn.net/wuzhekai1985/article/det原创 2015-03-26 02:12:36 · 683 阅读 · 0 评论 -
设计模式:创建型模式:单例模式(singleton pattern)
下面的内容主要来自于了1)深入浅出设计模式 by AI922)http://www.jellythink.com/archives/82 (这篇讲的特别深)单例模式的目的:保证一个类有且仅有一个对象,并提供一个访问这个对象的全局访问点。通常单例模式适合用于表示具有唯一性的对象,比如文件系统、资源管理器等。单例模式的实现方法:为了限制创建对象的个数,而且要原创 2015-03-26 05:51:31 · 580 阅读 · 1 评论 -
LeetCode[97]::Interleaving String C++
Given s1, s2, s3, find whether s3 is formed by the interleaving ofs1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", return原创 2015-08-22 23:40:00 · 855 阅读 · 0 评论