大鹏的博客

一个迷茫的小码农

数据结构-堆

堆通常是一个可以被看做一棵树的数组对象(用数组实现的二叉树)。堆总是满足下列性质: 堆中某个节点的值总是不大于或不小于其父节点的值; 堆总是一棵完全二叉树。(完全二叉树要求,除了最后一层,其它层的节点个数都是满的,并且最后一层的节点都靠左排列。) 将根节点为最大的值的称为...

2019-07-05 17:48:00

阅读数 10

评论数 0

spring-mvc

spring-mvc是基于servlet实现的,故必须配置web.xml 一.web.xml的配置 1.配置ContextLoadListener <listener> <listener-class>org.spring...

2019-07-05 11:27:24

阅读数 12

评论数 0

leetcode-135 Candy

There areNchildren standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re...

2019-07-04 10:43:29

阅读数 8

评论数 0

反射学习笔记

以Test类为例 public class Test{ public int age; public void getAge(){ return age; } } 1.类对象Class的获取 方法一: Class class = Test.cla...

2019-07-03 19:30:00

阅读数 26

评论数 0

leetcode-134 Gas Station

There areNgas stations along a circular route, where the amount of gas at stationiisgas[i]. You have a car with an unlimited gas tank and it costsco...

2019-07-01 16:41:14

阅读数 12

评论数 0

JDK动态代理实现原理

JDK动态代理步骤:(只能对实现接口的类进行代理) 1.创建被代理的接口和类; 2.创建InvocationHandler接口的实现类,在invoke方法中实现代理逻辑; 3.通过Proxy的静态方法newProxyInstance( ClassLoader classLoader,...

2019-06-28 10:18:19

阅读数 17

评论数 0

Spring AOP实现原理

AOP是在面向对象编程OOP下引入公共行为,导致一系列相同代码,如日志,安全检测等下产生的一种横向切面方法。 那么Spring中的aop关键是如何实现的? Spring主要对添加了@Aspect注解的类进行切面实现,根据以下方法 通过反射对注解类的进行缓存加载 存储在map...

2019-06-26 17:53:15

阅读数 19

评论数 0

JAVA 快速排序的实现

快速排序(Quicksort)是对冒泡排序的一种改进。 快速排序由C. A. R. Hoare在1960年提出。它的基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行...

2019-06-24 11:29:19

阅读数 17

评论数 0

spring对xml文件进行加载bean过程初步解析

以下是一段简单的通过类路径下的test.xml文件加载bean获得BeanFactory的代码:(对student进行依赖注入) BeanFactory bf = new XmlBeanFactory(new ClassPathResource("test.xml")); ...

2019-06-21 17:55:29

阅读数 28

评论数 0

leetcode-132 Palindrome Partitioning II

Given a strings, partitionssuch that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning ...

2019-06-18 14:37:50

阅读数 45

评论数 0

leetcode-131 Palindrome Partitioning

Given a strings, partitionssuch that every substring of the partition is a palindrome. Return all possible palindrome partitioning ofs. Example: ...

2019-06-13 10:59:37

阅读数 16

评论数 0

leetcode-130 Surrounded Regions

Given a 2D board containing'X'and'O'(the letter O), capture all regions surrounded by'X'. A region is captured by flipping all'O's into'X's in that ...

2019-06-12 19:26:00

阅读数 13

评论数 0

leetcode-129 Sum Root to Leaf Numbers

Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2-&...

2019-06-10 12:04:23

阅读数 18

评论数 0

leetcode 128 Longest Consecutive Sequence

Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Ex...

2019-06-06 15:25:49

阅读数 12

评论数 0

leetcode-125 Valid Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note:For the purpose of this problem, ...

2019-06-05 17:12:56

阅读数 21

评论数 2

leetcode-124 Binary Tree Maximum Path Sum

Given anon-emptybinary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any ...

2019-06-05 16:47:17

阅读数 17

评论数 0

leetcode-123 Best Time to Buy and Sell Stock III

Say you have an array for which theithelement is the price of a given stock on dayi. Design an algorithm to find the maximum profit. You may complet...

2019-06-05 09:01:56

阅读数 19

评论数 0

leetcode-122 Best Time to Buy and Sell Stock II

Say you have an array for which theithelement is the price of a given stock on dayi. Design an algorithm to find the maximum profit. You may complet...

2019-06-03 20:04:55

阅读数 15

评论数 0

leetcode-121 Best Time to Buy and Sell Stock

Say you have an array for which theithelement is the price of a given stock on dayi. If you were only permitted to complete at most one transaction ...

2019-06-03 16:46:26

阅读数 18

评论数 0

leetcode-120 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 ...

2019-05-31 17:17:07

阅读数 20

评论数 0

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