自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(277)
  • 资源 (3)
  • 收藏
  • 关注

原创 初探Spring AscpectJ 及其中的坑

一、what、whywhataop通常称为面向切面编程。通常我们讨论的是OOP(面向对象编程),面向切面编程是编程思想上一种改变。我对aop的理解是分离业务代码和非业务代码,通过代理的方式,将两部分耦合起来。非业务代码包括但不限于:性能检测,访问控制,日志记录等。why下面以具体的例子简单说明为什么需要aoppublic UnifyService { @Au...

2018-08-21 01:17:21 502

原创 Spring学习笔记(三)

Spring 装配集合前面介绍了spring装备单个类型的方法,有时候在开发中,成员变量可能为数组、 list、set和map等。对于sprint而言,也提供了相应的集合装配元素。 装配list类型的值,允许重复; 装配set类型的值,不允许重复; 装配map类型的值,key和value可以是任意类型; 装配properties类型的值,key和value都是String

2017-05-01 19:05:23 299

原创 Spring学习笔记(二)

spring XML配置文件中bean的用法及意义bean:创建应用组件之间协作行为的通常称作装配,spring有多种装配bean的方式。在XML中,我把bean理解为一个对象,通过配置bean,可以管理这个对象的实现方式。以setter注入方式为例,bean的配置基本情况如下: <bean id = "Jack" class = "com.mawu.java.util.Signer">

2017-05-01 14:21:08 254

原创 Spring学习笔记(一)

由于公司项目的原因,开始接触到sprin,从一脸懵逼开始,于是一边请教同学,一边买了本Spring实战开始看起来,现在简单记录下,加深记忆在我目前学习过程而言,spring的关键还在于通过xml配置文件的依赖注入实现对象之间的松耦合。依赖注入主要有三种形式:构造器注入,setter注入和p注入,其中p注入是setter注入的简化形式。假设有如下代码块:package mawu.com;cl

2017-05-01 01:25:16 267

原创 32. Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which

2016-09-04 10:08:22 263

转载 动态规划之01背包问题

转载自:http://blog.sina.com.cn/s/blog_6dcd26b301013810.html首先是问题描述:给定n种物品和一背包,物品i的重量是wi,其价值是pi,背包的容量是M,问如何选择装入背包中的物品总价值最大?可以这样理解:背包的背负有上限,因此在这个上限内尽可能多的装东西,并且价值越多越好。在这里我之想讨论动态规划解决这个问题的详细过程。

2016-08-30 12:28:18 300

转载 C++笔试题

来源:http://www.nowamagic.net/librarys/veda/detail/5191. 以下三条输出语句分别输出什么?1char str1[] = "abc";2char str2[] = "abc";3const char st

2016-08-29 21:16:17 486

转载 总结---1

转载自:http://www.cnblogs.com/heyonggang/p/3308377.html1.const与 #define有什么不同?答:C++中可以使用const定义常量,也可以用#define定义常量,但是前者比后者有更多的优点①const常量有数据类型,而宏常量没有数据类型。编译器可以对前者进行类型安全检查,而对后者只是进行字符替换,没有做类

2016-08-29 20:28:29 532

转载 位运算

位运算  位运算是把数字用二进制表示之后,对每一位上0或者1的运算。  理解位运算的第一步是理解二进制。二进制是指数字的每一位都是0或者1.比如十进制的2转化为二进制之后就是10。在程序员的圈子里有一个流传了很久的笑话,说世界上有10种人,一种人知道二进制,而另一种人不知道二进制。。。。。。  其实二进制的运算并不是很难掌握,因为位运算总共只有5种运算:与、或、异或、左移、右移。如下表

2016-08-29 20:23:33 323

转载 树的子结构

面试题目:输入两颗二叉树A,B,判断B是不是A的子结构;先找到B根节点对应的A的节点,在判断是否相同。主要部分代码:bool ifTheSameTree(BiTree &t1,BiTree &t2){ if (t2 == NULL)return true;//B树为空,肯定是相同的树 if(t1 == NULL)return false; if (t1->

2016-08-29 20:09:22 360

转载 根据前序和中序推出后序

最近面试总遇到这种根据给出的两类序遍历,然后求按另一种形式序的遍历。看来有必要好好总结下这个知识点,省的每次笔试时都得花不少时间推导。首先,我们看看前序、中序、后序遍历的特性: 前序遍历:(根—>左—>右)    1.访问根节点     2.前序遍历左子树     3.前序遍历右子树 中序遍历:(左—>根—>右)    1.中序遍历左子树  

2016-08-29 20:06:04 1412

转载 寻找数组中第二大或第二小的数值

昨天晚上参加了360校园招聘的笔试,其中最后一道笔试题就是找数组中的第二大的数。可以看出今年360笔试的试题还是不难的,想起昨晚提前把试题做完后,提前把试卷给交了,就和旁边的北大的一哥们聊天,聊最近的各种笔试、面试以及被鄙视。快到公交站时,还讨论着明天的腾讯、百度,以及晚上的去哪儿网的笔试。找工作还确实是个体力活啊!到处赶场。2013年360校园招聘题:写一个函数找出一个整数数组中,第

2016-08-29 19:58:09 3246

转载 删除链表中的重复元素

昨晚在参加兰亭集势的笔试时,看到了这样一个题目。大致意思就是给出一个单链表,链表中有重复的元素,需要删除重复的元素。如:1→2→3→5→4→3→7,删除重复元素后变成1→2→3→5→4→7。思路其实还蛮简单:建立三个工作指针p,q,r,然后p遍历全表。p每到一个结点,q就从这个结点往后遍历,并与p的数值比较,相同的话就free掉那个结点。LinkList RemoveDupNode(Lin

2016-08-29 17:04:22 455

转载 判断单链表是否存在环

周末参加完美世界校园招聘中就有一道判断单链表是否有环的编程题。写一个C/C++函数,来判断一个单链表是否具有环,如果存在环,则给出环的入口点。有一个单链表,其中可能有一个环,也就是某个节点的next指向的是链表中在它之前的节点,这样在链表的尾部形成一环。现在需要解决的问题有以下两个:如何判断一个链表是不是这类链表?如果链表为存在环,如果找到环的入口点?判断链表是否存

2016-08-29 17:00:34 421

转载 寻找和为定值的两个数

题目:输入一个数组和一个数字,在数组中查找两个数,使得它们的和正好是输入的那个数字。要求时间复杂度是O(n)。如果有多对数字的和等于输入的数字,输出任意一对即可。例如输入数组1、2、4、7、11、15和数字15。由于4+11=15,因此输出4和11。 解析:如果数组是无序的,先排序(n*logn),然后用两个指针i,j,各自指向数组的首尾两端,令i=0,j=n-1,然后i++,j-

2016-08-29 16:34:02 305

转载 100阶乘末尾有多少个零

题目:1*2*3*……*100 求结果末尾有多少个零 分析:一般类似的题目都会蕴含某种规律或简便方法的,阶乘末尾一个零表示一个进位,则相当于乘以10而10 是由2*5所得,在1~100当中,可以产生10的有:0 2 4 5 6 8 结尾的数字,显然2是足够的,因为4、6、8当中都含有因子2,所以都可看当是2,那么关键在于5的数量了那么该问题的实质是要求出1~100含有多少个5由特殊

2016-08-29 16:29:20 557

转载 TCP第三次握手失败怎么办

当失败时服务器并不会重传ack报文,而是直接发送RTS报文段,进入CLOSED状态。这样做的目的是为了防止SYN洪泛攻击。

2016-08-29 16:23:31 1471

转载 memcpy的函数

void * memcpy(void * des, void * src, size_t count){ if(des==NULL || src==NULL){ return NULL; } void * ans = des; des = static_cast dest; src = static_cast src; if(des>

2016-08-29 14:49:36 425

转载 已知ip地址和其子网掩码如何求网络号子网号主机号

已知ip地址为10.130.89.95,其子网掩码为255.255.255.224,求其网络号、子网号和主机号。要看子网掩码变长在第几节,255.255.255.224是在第四节借了位 把224转换为2进制,windows的计算器科学型能帮你计算。是11100000,借了三位 借了三位,子网个数为2的三次方等于8 即八个子网 其实书上说得挺复杂,我感觉,计算网络号最简单的方法就是

2016-08-29 14:34:38 25508 3

转载 最长回文字符串_manacher算法

回文串就是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。回文子串,顾名思义,即字符串中满足回文性质的子串。比如输入字符串 "google”,由于该字符串里最长的对称子字符串是 "goog”,因此输出4。算法的基本思路是这样的:把原串每个字符中间用一个串中没出现过的字符分隔#开来(统一奇偶),同时为了防止越界,在字符串的首部也加入一个特殊符$,但是与分隔符不

2016-08-29 14:24:59 369

原创 213. House Robber II

Note: This is an extension of House Robber.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

2016-08-28 13:49:46 308

原创 153. Find Minimum in Rotated Sorted Array

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 minimum element.You may assume no duplicate exists in the arra

2016-08-27 18:22:31 312

原创 319. Bulb Switcher

There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off

2016-08-27 14:37:19 366

原创 229. 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.Subscribe to see which companies asked this ques

2016-08-20 23:41:36 237

原创 306. Additive Number

Additive number is a string whose digits can form additive sequence.A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the s

2016-08-20 22:22:02 207

原创 50. Pow(x, n)

Implement pow(x, n).Subscribe to see which companies asked this question注意nclass Solution { double Pow(double x, int n) { if(n==0) return 1; if(n==1) re

2016-08-18 21:05:02 182

原创 209. Minimum Size Subarray Sum

Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead.For example, given the array [2,3,1

2016-08-17 22:31:30 194

原创 134. Gas Station

There are N gas stations along a circular route, where the amount of gas at stationi is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from stationi to it

2016-08-17 21:52:17 215

原创 131. 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[ ["aa","b"], [

2016-08-16 20:59:43 155

原创 40. Combination Sum II

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inC where the candidate numbers sums to T.Each number in C may only be used once in the combinatio

2016-08-15 11:55:55 172

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

2016-08-15 11:30:21 213

原创 Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[ [1,1,2], [1,2,1], [2,1,1

2016-08-15 10:59:20 166

原创 49. Group Anagrams

Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"]]Note: All inputs

2016-08-15 09:53:31 143

原创 113. Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5 / \

2016-08-15 09:46:52 224

原创 200. Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume

2016-08-13 22:13:28 229

原创 Unique Binary Search Trees II

Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all 5 unique BST's shown below. 1

2016-08-13 21:20:16 173

原创 17. 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

2016-08-01 23:50:12 178

转载 面试笔试题

面试笔试题

2016-08-01 19:33:37 305

原创 34. Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found in

2016-07-28 16:23:57 131

原创 106. Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Subscribe to see which companies asked this question注意

2016-07-28 15:08:13 152

关闭QPCore服务的方法

腾讯的服务QPCore不能关闭,拒绝访问。可以通过卸载qq,运行f1.bat。安装国际版的方法禁止QPCore服务

2016-08-11

python xlrd3 安装包 用于python3以后的版本

2016-07-27

protobuf-wireshark-runtime-0.1.tar.gz

用来编译自定义用于wireshark的protobuf插件

2016-06-22

空空如也

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

TA关注的人

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