wangyw Blog

Constant dropping wears the stone

使用Hibernate框架开发步骤

使用Hibernate框架开发步骤 1. 创建Hibernate配置文件 2. 创建持久化类 3. 创建对象-关系映射文件 4. 通过HibernateAPI编写访问数据库的代码 具体实现代码 1. 创建Hibernate配置文件 Hibernate配置文件的两个配置项 hbm2ddl.auto: 该属...

Find the Duplicate Number

287. Find the Duplicate Number 题意 TGiven an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume tha...

Roman Integer

罗马数和整形的相互转换

罗马数和整形的相互转换 1、Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 代码 class Solution { public: int romanToInt(string...

N-Queens

n皇后问题

NQueens问题 N-Queens I The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to...

Pascal's Triangle

杨辉三角形

118. Pascal’s Triangle 题意 Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4...

再见 我心中的传奇-布莱恩特

再见! 我心中的传奇-布莱恩特 二十年 你用二十年的时间诠释对于胜利的渴望 二十年 你用二十年的时间展现对于篮球的挚爱 二十年 你用二十年的时间展示无与伦比的球技 这二十年你带给这世界太多太多的执着,不屈,惊艳,神奇…… 60分 用最熟悉的方式离开这片场地,离开这座球馆,离开你最热爱的运动,注定传奇一生 科比,你的固执,你的骄傲,你的后仰,你的伤痛,你的荣誉,所有的一切都要...

春暖花开

春暖花开

Reverse Linked List

链表翻转

206. Reverse Linked List 解法一(递归方法) class Solution { public: ListNode* reverseList(ListNode* head) { if(head==NULL||head->next==NULL) return head; ...

Spring JdbcTemplate

Spring使用JdbcTemplate 配置数据库资源文件db.properties user1=root password=root driverclass=com.mysql.jdbc.Driver jdbcurl=jdbc:mysql:///product initPoolSize=5 maxPoolSize=10 Spring配置文件 <?xml version="...

Majority Element

出现次数大于数组长度一半的元素

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