自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(315)
  • 资源 (2)
  • 收藏
  • 关注

转载 索引与优化

写在前面:索引对查询的速度有着至关重要的影响,理解索引也是进行数据库性能调优的起点。考虑如下情况,假设数据库中一个表有10^6条记录,DBMS的页面大小为4K,并存储100条记录。如果没有索引,查询将对整个表进行扫描,最坏的情况下,如果所有数据页都不在内存,需要读取10^4个页面,如果这10^4个页面在磁盘上随机分布,需要进行10^4次I/O,假设磁盘每次I/O时间为10ms(忽略数据传输时间),

2015-10-19 11:13:09 499

原创 android四大组件

android四大组件分别为activity、service、content provider、broadcast receiver。一、android四大组件详解1、activity(1)一个Activity通常就是一个单独的屏幕(窗口)。(2)Activity之间通过Intent进行通信。(3)android应用中每一个Activity都必须要在Andr

2015-10-12 08:53:59 454

原创 苏宁2016研发工程师编程题

1.判断一个链表是否有环(只能使用两个指针)。2.给定整数n,求n!阶乘末尾0的个数。3.求一个字符串的最长子字符串,最长子字符串定义为其中没有重复的字符。4.n个人有m对好友,求其中的朋友圈的数目。5.用户信息表包含用户名,地址,商品销售信息表包含商品名,数量,价格,出售时间。要求可以查到每个用户购买的商品信息。建立两个表。查询用户“张三“的信息,购买的全部商品,最近

2015-09-14 16:02:44 606

原创 Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]

2015-09-06 09:55:42 384

原创 Remove Linked List Elements

Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5等于给定的val,就跳过。public class

2015-09-04 09:32:02 358

原创 linux命令

1.      cut在一行信息中取出某部分我们想要的 cut –d ‘分隔字符’ –f  fileds  cut –c  字符范围           范例一:将path变量取出,找出第三和第五个路径echo $path | cut –d ‘:’ –f 3,5范例二:将export输出的信息取得第12字符以后的所有字符串export | cut –c 12-

2015-09-02 21:49:13 379

原创 Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return 5.

2015-08-28 22:06:35 389

原创 2016阿里在线笔试Java研发附加题

1.一组整型数中,有一个数字重复3遍,其它数字重复2遍,请找出这个重复3遍的数字。比如:[88, 459, 5262, 88, -17, 677, 88, 667, -17, 459, 5262], 结果为88。要求程序代码中额外申请的空间为O(1),请给出一个平均时间复杂度不大于O(nlogn)的算法。请首先用文字阐述答题思路,然后用Java程序实现。2.在招财进宝平台上

2015-08-26 21:26:22 2235

原创 Ugly Number II

Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the first 10

2015-08-24 18:36:59 328

原创 Ugly Number

Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since

2015-08-24 18:10:43 295

原创 Add Digits

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one 

2015-08-22 20:58:36 420

原创 Binary Tree Paths

Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]求二叉树的路径。用深度搜

2015-08-22 20:32:40 341

原创 Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.public class Solution

2015-08-22 20:01:32 348

原创 Search a 2D Matrix II

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integers in ea

2015-08-22 15:52:29 246

原创 Sliding Window Maximum

Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding wind

2015-08-21 20:27:49 292

原创 Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(n).

2015-08-21 18:52:18 282

原创 Lowest Common Ancestor of a Binary Tree

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. _______3______ / \ ___5__ ___1__ / \ / \

2015-08-20 19:01:25 334

原创 Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw

2015-08-20 14:32:59 259

原创 Palindrome Linked List

Given a singly linked list, determine if it is a palindrome.用常数变量解决的思路是:找到链表中点,翻转后半部分,从头开始遍历两个链表,如果某个节点的值不相等,返回false。需要注意的是链表只有一个或两个元素的情况。public boolean isPalindrome(ListNode head) { if(head

2015-08-20 13:52:18 299

原创 Number of Digit One

Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6, because digit 1 occurred in the followin

2015-08-20 10:39:05 364

原创 Power of Two

Given an integer, write a function to determine if it is a power of two.判断一个数是不是2的指数。如果是2的指数,那么它的二进制表示就只有一个1.所有n与n-1是否等于0就可以判断。public class Solution { public boolean isPowerOfTwo(int n) {

2015-08-20 10:10:36 306

原创 Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.找到二叉搜索树中的第k小的元素。使用栈,如果有

2015-08-20 09:49:53 294

原创 Summary Ranges

Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].应该保存一个范围的初始点和结束点,并在一个范围add进list后更新。分为后一个元素是前一个+1和不是

2015-08-19 22:12:14 325

原创 Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1使用队列来存储节点,交互节点的左右子树。public TreeNode invertTree(TreeNode root) { if(roo

2015-08-19 14:22:13 280

原创 Implement Queue using Stacks

Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.

2015-08-19 13:48:20 227

原创 Implement Stack using Queues

Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Ret

2015-08-19 13:30:09 250

原创 Basic Calculator

Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty

2015-08-19 10:38:52 247

原创 Rectangle Area

Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume that the total

2015-08-19 09:03:17 273

原创 Count Complete Tree Nodes

Given a complete binary tree, count the number of nodes.完全二叉树,就是除了叶结点都有两个结点。如果左右子树的高度相同,结点个数为2^h-1。否则可以遍历左右子树的结点和+1.public int countNodes(TreeNode root) { int count=0; int left=leftHeight(root

2015-08-18 21:29:29 279

原创 Maximal Square

Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0

2015-08-18 21:05:43 310

原创 Contains Duplicate III

Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference between i and

2015-08-18 15:05:41 381

原创 Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.用map

2015-08-18 11:06:23 274

原创 Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every elemen

2015-08-18 10:59:38 274

原创 Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return 5.

2015-08-18 10:53:12 289

原创 Add and Search Word - Data structure design

Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regular expression string containing only l

2015-08-17 21:05:31 323

原创 Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.trie树,又叫字典树,单词查找树。它有三个特性:根节点不包含字符,除根节点外每一个节点都只包含一个字符; 从根节点到某一节点,路径上经过的字符连接起来,为该节点对应的字符串; 每个节点的所有子节点包含的字符都不相同。一个trie node应该包括它的c

2015-08-17 20:33:54 226

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

2015-08-17 14:48:56 284

原创 Course Schedule II

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a

2015-08-17 13:48:52 203

原创 Course Schedule

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a

2015-08-17 10:37:18 277

原创 Isomorphic String

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with another

2015-08-16 15:25:59 378

Selenium2 Python自动化测试实战(有13,14章)

《selenium2 python 自动化测试实战(第二版)》 虫师

2017-12-21

计算机复习提纲

南邮计算机网络的复习提纲

2013-12-19

空空如也

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

TA关注的人

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