自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

转载 IDEA配置JPBC库

IntelliJ IDEA + JPBC 設置转自https://cat.chriz.hk/2019/12/intellij-idea-jpbc.html

2020-06-09 00:08:10 1194

转载 【java学习】MVC和三层架构

2018-10-14 14:27:06 246

原创 【java学习】javaMail学习

import java.util.Properties;import javax.mail.Authenticator;import javax.mail.Message;import javax.mail.MessagingException;import javax.mail.PasswordAuthentication;import javax.mail.Session;im...

2018-10-14 14:25:18 197

原创 【java学习】RTTI与反射机制

RTTI:运行时识别一个对象的类型 Java程序中,所有的类都是在对其第一次使用时,动态加载到JVM中的。当程序创建第一个对类的静态成员的引用时,就会加载这个类。 证明了构造器也是类的静态方法,即使构造器之前没有使用static关键字,因此,使用new操作符创建类的新对象也会被当做对类的静态成员的引用 Java程序在它开始运行之前并非被完全加载,各个部分是在必需时才加载        ...

2018-10-10 10:10:42 171

原创 【j2ee学习】jsp传统标签开发

一、标签技术的API二、标签API简单介绍      1.  JspTag接口:   JspTag接口是所有自定义标签的父接口,是JSP2.0中新定义的一个标记接口,没有任何属性和方法,JspTag接口有Tag和SimpleTag两个直接子接口,把实现Tag接口的自定义标签也叫做传统标签,把实现SimpleTag接口的自定义标签叫做简单标签。      2. Tag接口:  ...

2018-09-25 20:25:03 134

原创 【J2ee学习】Sevlet+JSP+JavaBean开发模式_整理所得

通常会选择Servlet+JSP+JavaBean开发模式来开发JavaWeb项目,Servlet+JSP+JavaBean组合开发就是一种MVC开发模式了,控制器(Controller)采用Servlet、模型(Model)采用JavaBean、视图(View)采用JSP。 一、Web开发中的请求---响应模型具体的步骤     web浏览器发送请求,访问某个URL http:/...

2018-09-21 21:04:13 1247

原创 【设计模式】行为型模式--观察者模式

观察者模式概述:定义对象间的一种一对多的依赖关系,当一个对象的状态发生改变时,所有依赖于它的对象都得到通知并被自动更新。 何时使用:一个对象(目标对象)的状态发生改变,所有的依赖对象(观察者对象)都将得到通知,进行广播通知。 关键代码:在抽象类里有一个 ArrayList 存放观察者们。 Subject 对象带有绑定观察者到 Client 对象和从 Client 对象解绑观察者的方法...

2018-09-09 15:59:26 113

原创 【设计模式】行为型模式--备忘录模式

备忘录模式在不破坏封装性的前提下,捕获一个对象的内部状态,并在该对象之外保存这个状态。 何时使用:很多时候我们总是需要记录一个对象的内部状态,这样做的目的就是为了允许用户取消不确定或者错误的操作,能够恢复到他原先的状态,使得他有"后悔药"可吃。 如何解决:通过一个备忘录类专门存储对象状态。 使用场景: 1、需要保存/恢复数据的相关状态场景。 2、提供一个可回滚的操作 Memento...

2018-09-09 15:37:59 96

原创 【设计模式】创建型模式(整理所得)

创建型模式   概述:提供了一种在创建对象的同时隐藏创建逻辑的方式,而不是直接使用new运算符实例化对象 工厂模式:意图:定义一个创建对象的接口,让其子类自己决定实例化哪个工厂类,工厂模式使其创建过程延迟到子类进行。 何时使用:明确的计划不同条件下创建不同实例时 关键代码:创建过程在其子类执行 优点: 1、调用者想创建一个对象,只要知道其名称就可以了。 2、扩展性高,如果想增...

2018-09-09 15:00:40 218

转载 二分查找

2018-05-02 15:17:43 167

原创 【Leetcode】66. Plus One

Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list, and each element i...

2018-04-30 17:57:16 152

原创 【Leetcode】53. Maximum Subarray

题目:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.找到拥有最大的和的连续的子数组//也可以用smax = max(smax,sum);class Solution { p...

2018-04-01 21:54:46 109

原创 【Leetcode】35. Search Insert Position

题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.给定...

2018-04-01 21:51:06 80

原创 【Leetcode】27 Remove Element

//题目:Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input a...

2018-04-01 21:42:08 101

原创 【Leetcode】26 Remove Duplicates from Sorted Array

//题目Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modif...

2018-04-01 21:35:48 89

原创 【Leetcode】2.reverse-integer

题目Given a 32-bit signed integer, reverse digits of an integer.32-bit很大,所以要按位来//调试,可以设置断点,可以单步调试,看究竟是哪里出错//要看代码逻辑,什么变量究竟是什么值#include <iostream>using namespace std;class Solution{public: i...

2018-04-01 21:33:04 155

原创 【Leetcode】1. Two Sum

//题目要求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, and you may not use the s...

2018-04-01 21:31:05 96

原创 二叉树构造与遍历

#include#include#includeusing namespace std;/*class link{public: int data; link* next; link(int d):data(d),next(NULL){} link *head; link* tail; };class stack{public: link *top;

2018-01-22 16:20:49 162

原创 合并链表

#include #includeusing namespace std;struct ListNode { int val; ListNode* next; ListNode(int i):val(i),next(NULL){} //c++中可以给结构体中加函数,这里用来赋值};class List{ //链表类:头尾指针,构造析构,插入数值,打印,返回第一个数,删除,清

2018-01-22 16:20:32 187

原创 BST构造

#includeusing namespace std;#includeclass BstTree{ struct Node{ Node *left; Node *right; int data; Node(int i):data(i),left(NULL),right(NULL){ } };public: Node* ro

2018-01-22 16:20:16 399

原创 最小堆与huffman树

#include #include template class MinHeap {private: T * heapArray; int currentSize; int MaxSize; void siftUp(int position){ int par=parent(position); while (position

2018-01-22 16:20:01 206

原创 各种排序

#includeusing namespace std;/* *Insertion sort *stable *best case: n *worst case:n^2 *average case:n^2 */void Insertionsort(int arr[],int n){ for(int i=1;i<n;i++){ for(int j=i;(j>0&&arr

2018-01-22 16:19:43 128

原创 General Tree

相关术语及定义:(1)Root: 树T是由一个或一个以上的结点组成的有限集,R称为根节点 (2)Subtree: 集合(T-|R|)非空时,集合中结点被划分成n个不相交的子集,每个子集都是树,子集Ti称为T的subtree,定义i < j,Ti位于Tj之前,T0为最左子节点 (3)结点的子结点数目:该结点的出度(out degree) (4)forest: 1/n颗树 (5)ancestor

2017-11-25 17:22:16 1103

原创 快速排序

点击打开链接

2017-07-19 08:50:56 191

原创 InsertionSort_插入排序

关键码:数据元素中某个数据项的值; - 例如,学生信息中的学号即为主关键码 - 若在待排序的纪录中,存在两个或两个以上的关键码值相等的纪录,经排序后这些记录的相对次序仍然保持不变,则称相应的排序方法是稳定的方法,否则是不稳定的方法。-内部排序和外部排序 - 根据排序过程中涉及的存储器不同: - 内部排序:待排序数据主要存

2017-07-18 19:22:36 227

原创 大O表示法_时间复杂度

引入原因:用另一个(通常更简单的)函数来描述一个函数数量级的渐近上界。定义:如果一个问题的规模是n,解这一问题的某一算法所需要的时间为T(n),它是n的某一函数。T(n)称为这一算法的“时间复杂度”。某个算法的复杂度到达了这个问题复杂度的下界,那就称这样的算法是最佳算法决定算法复杂度的是执行次数最多的语句复杂度与时间效率的关系:c < log2n < n < n*log2n < n2 < n

2017-07-18 19:03:36 1007

空空如也

空空如也

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

TA关注的人

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