自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

沫沫的进阶之路

记录点滴

  • 博客(64)
  • 资源 (2)
  • 收藏
  • 关注

原创 WebDriver Selenium eclipse环境搭建

WebDriver在eclipse环境下的搭建

2017-04-14 10:36:18 6094 5

原创 数据库备份和恢复--数据的导入导出 (mysql)

导出数据库中一个库所有数据结构和数据 mysqldump 数据库名 -u root -p >jxn.sql只导出结构不导出数据 mysqldump -d 数据库名 -u root -p >struct.sql只导出数据不导出结构 mysqldump -t 数据库名 -u root -p >data.sql只导出数据表的数据结构和数据 mysqldump -u root -p 数据库名

2017-01-12 15:47:45 409

原创 常见的数据库操作:创建,查看,插入,删除,主键(mysql)

单表插入数据,修改一行数据,修改多行数据,查询数据,删除一行数据,删除多行数据。单行数据操作单表插入数据:insert into tablename (列名) values (对应值);修改一行数据:update tablename set 列名=值 where 列名=值 where之后是查找条件。删除一行数据:delete from tablename where 列名=值多行数据操作插

2017-01-12 15:32:59 532

原创 [Leetcode] 435. Non-overlapping Intervals

题目: leetcode链接 Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note: * You may assume the interval’s end p

2017-01-12 15:21:42 328

原创 [Leetcode] 108. Convert Sorted Array to balanced Binary Search Tree

题目: leetcode链接 Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题意: 给定一个升序的数组,将其转化成平衡二叉搜索树。具体代码:/** * Definition for a binary tree node. * public clas

2017-01-12 15:20:13 223

原创 [Leetcode] 452. Minimum Number of Arrows to Burst Balloons

题目:leetcode链接 There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it’s horizon

2017-01-12 15:17:48 194

原创 [Leetcode] 406. Queue Reconstruction by Height

题目: leetcode链接Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in

2017-01-12 15:16:18 214

原创 [Leetcode] 453 Minimum Moves to Equal Array Elements

题目: leetcode链接 Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 elements by 1. example: Input

2017-01-12 15:13:35 223

原创 [Leetcode] 413. Arithmetic Slices

题目:leetcode链接题意:求一串数字中有3个及以上连续数字组成的等差数列的个数。 例子: [1,2,3,4] 组成的有3个分别是[1,2,3],[2,3,4],[1,2,3,4];解题思路: 求出该数组中能有超过连续3个数组成等差数列的个数,然后再把每个等差数列进行拆分,求最终的个数。具体代码实现:public class Solution { public int number

2017-01-12 15:11:47 244

原创 [Leetcode] 378 Kth Smallest Element in a Sorted Matrix

题意: 在一个二维数组中按行有序,按列也有序,在这个二维数组中找第k大的数 思路: 使用最小堆的思想。在最小堆中找到第k个数 实现方法: 利用java中自带的优先队列实现最小堆的思想 具体代码实现: public class Solution { public int kthSmallest(int[][] matrix, int k) { int result = 0

2017-01-12 15:10:55 188

原创 [Leetcode] 230. Kth Smallest Element in a BST

题目: 题意: 给定一个二叉搜索树,求树中最小的第K个元素 思路: 对树进行中序遍历得到是会是有序的从小到大的结果,直接取中序遍历结果的第k元素就是结果具体代码:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * Tre

2017-01-12 15:09:44 175

原创 [Leetcode]113. Path Sum II 求路径和一个数的所有路径

[题目:][9]题意:给定一个二叉树,和一个整数,求二叉树中所有从根节点到叶子节点的路径和等于这个整数的路径。代码实现:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * Tree

2017-01-12 15:08:36 443

原创 [Leetcode]404. Sum of Left Leaves

题目:题意: 求二叉树中所有结点的左叶子结点之和具体代码:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * }

2017-01-12 15:07:39 192

原创 [leetcode] 300. Longest Increasing Subsequence

题目:leetcode 300题链接 Given an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3

2017-01-12 15:03:31 222

原创 unbuntu安装mysql

安装:使用:sudo apt-get install mysql-server mysql-client遇到的问题及解决方案使用安装命令安装时,显示如下信息: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) Unable to lock the administration d

2017-01-12 14:39:59 246

原创 [Leetcode]394. Decode String

题目:[leetcode 394 链接]题意: 解码k[encoded_string] 例如2[a] 解码后结果为aa 2[a2[b]]解码结果是abbabb思路: 从内层括号向外层括号解码我的实现思路, 1) 先找到最后一个[的位置,然后找到离其最近的]然后确定[前面的数字,把[]之间的字符串重复,然后将重复的字符串把从数字开始到]位置之间的字符全部替换成转化后的结果。 然后重复1)步骤

2016-12-29 15:21:10 240

原创 [Leetcode]199. Binary Tree Right Side View

题目:]题意: 给出一个二叉树,得到从右边看能看到的节点思路: 对二叉树进行层次遍历,保留每层的最后一个元素我的具体做法:是用两个队列分别保存隔层元素,当一个节点出队后队为空,则表示为该层的最后一个节点具体代码实现:/* * Definition for a binary tree node. * public class TreeNode { * int val; * Tr

2016-12-29 15:19:43 177

原创 [Leetcode]357. Count Numbers with Unique Digits

题目:题意: 给出n,求出在0到 10 ^ n 次方之间的各位各不相同的数。思路: 相当于求n+1位,每位各不相同的数的个数。 当n = 1时,这一位有10 中选择 当n = 2时,第一位有9种选择(不能选择0),此时第二位也有9种选择。所以当数为两位数时有9 * 9种可能,但是因为数是在[0,100)之间,所以要加上当数只有一位数字的情况,即9 * 9 + 10; 当n = 3时,第一位9种

2016-12-29 15:17:58 224

原创 [Leetcode]384. Shuffle an Array

384. Shuffle an Array题目[leetcode链接] Shuffle a set of numbers without duplicates.Example:// Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nums);// Shuffle

2016-12-29 15:16:36 234

原创 [Leetcode]382. Linked List Random Node

题目:[leetcode]Given a singly linked list, return a random node’s value from the linked list. Each node must have the same probability of being chosen.Follow up: What if the linked list is extremely lar

2016-12-29 15:13:39 246

原创 [Leetcode] 436. Find Right Interval

leetcode题目 题意:给定一组区间,求给定区间 在这些区间中 在给定区间右侧,且与给定区间距离最近区间的位置。思路: 把给定区间的右边界与这些区间中的左边界进行比较,选择出,左边界比给定区间右边界大,且距给定区间最近区间。获取该区间的位置。具体代码实现: 利用java TreeMap的性质,把所有区间的左边界作为key值,所在位置作为value值,保存在map中,利用TreeMap中已

2016-12-07 14:19:46 661

原创 [leetcode] 62. Unique Paths

A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bo

2016-08-30 18:38:23 244

原创 [leetcode] 回溯法 Combination Sum 系列问题

题目: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited number

2016-08-30 14:51:16 399

原创 [leetcode] 377.Combination Sum IV

Example:nums = [1, 2, 3] target = 4The possible combination ways are: (1, 1, 1, 1) (1, 1, 2) (1, 2, 1) (1, 3) (2, 1, 1) (2, 2) (3, 1)Note that different sequences are counted as different combi

2016-08-30 11:29:40 1176 2

原创 [leetcode] 121. Best Time to Buy and Sell Stock

题目: Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),

2016-08-26 16:50:39 412

原创 [leetcode] 122. Best Time to Buy and Sell Stock II

题目: Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on

2016-08-26 16:20:47 384

原创 java源码学习----ArrayList

源码分析类的继承关系ArrayList的默认大小为10ArrayList的底层实现构造函数1 无参构造函数2 指定大小的构造函数3 利用集合构造常用函数1 size求大小2 isEmpty判断是否为空3 增 add4 删 remove5 改 set6 查 get7 某个元素所在的位置8 是否包含某个特定元素注意的问题源码分析1 . 类的继承关系public cla

2016-08-23 11:28:57 367

转载 Collection 集合大家族

转载来自 http://www.cnblogs.com/chenssy/p/3495238.html在编写java程序中,我们最常用的除了八种基本数据类型,String对象外还有一个集合类,在我们的的程序中到处充斥着集合类的身影!java中集合大家族的成员实在是太丰富了,有常用的ArrayList、HashMap、HashSet,也有不常用的Stack、Queue,有线程安全的Vector、Ha

2016-08-23 10:27:48 1488

原创 [leetcode] 96. Unique Binary Search Trees

题目: Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example, Given n = 3, there are a total of 5 unique BST’s.思路: 当n = 1 时 BST的个数是1; 当n = 2 时 BST的个数是2;

2016-07-22 17:18:04 176

原创 [leetcode] 376. Wiggle Subsequence

题目:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either p

2016-07-22 15:57:54 536

原创 [leetcode] 101. Symmetric Tree

题目: leetcode 链接思路:分别判断对称位置的值是否相同,即根节点的左子树的左节点和右子树的右节点 与 左子树的右节点和右子树的左节点是否都相同。并依次按左子树的左节点和右子树的右节点 左子树的右节点和右子树的左节点深入比较下去。递归代码:/** * Definition for a binary tree node. * public class TreeNode { *

2016-07-18 10:56:34 206

原创 [leetcode] 107. Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example: Given binary tree [3,9,20,null,null,15,7],

2016-07-18 10:12:01 221

原创 [leetcode] 198. House Robber

题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent h

2016-07-18 08:33:28 241

原创 [Leetcode] 226. Invert Binary Tree

题目: Invert a binary tree.4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1思路: 从根节点开始,交换根节点的左右子树,然后依次向下遍历。具体代码:/** * Definition for a binary tr

2016-06-29 15:35:50 213

原创 [Leetcode] 273. Integer to English Words

题目: Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example, 123 -> “One Hundred Twenty Three” 12345 -> “Twelve Thousand

2016-06-22 09:39:13 220

原创 hadoop2.6.3配置及遇到的问题

我的配置过程参考的是 hadoop2.6.3版本的配置但是在格式化HDFS中报错 java.net.UnknownHostException: 解决方案是:1.查看 /etc/hosts 显示的是localhost与上面的主机名hgf不一致 2.修改 /etc/hosts 使其与之前的host一致 3.再次格式化HDFS成功

2016-06-21 10:19:30 326

原创 [Leetcode] 49. Group Anagrams

题目: 链接 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”

2016-06-15 10:04:13 231

原创 [Leetcode] 350. Intersection of Two Arrays II

题目: Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appear as many times as

2016-06-15 09:03:16 197

原创 [Leetcode] 60. Permutation Sequence

题目: The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3):"123""132""213""231""312

2016-06-12 16:20:27 210

原创 [Leetcode] 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

2016-06-03 10:33:07 306

超市管理系统

JDBC 跟数据库mysql交互,提供了登录、入库管理、销售界面界面。在销售界面通过输入货号即可得到价格信息并将一次销售的的东西的详细信息在窗口显示并计算总价格。

2012-09-20

Thinking In Java(中文第四版)

很好的一本java书 ,java学习中永远值得收藏的一本

2012-06-27

空空如也

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

TA关注的人

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