自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Leetcode 182. Duplicate Emails

Write a SQL query to find all duplicate emails in a table named Person.+----+---------+| Id | Email |+----+---------+| 1 | a@b.com || 2 | c@d.com || 3 | a@b.com |+----+---------+For e...

2018-07-27 10:30:09 166

原创 Leetcode 189. Rotate Array

Given an array, rotate the array to the right by k steps, where k is non-negative.Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the right: [7,1...

2018-07-22 15:28:48 118

转载 自定义注解提示:RetentionPolicy/ElementType cannot be resolved to a variable

在开发excle的通用导入导出功能,用到注解,报如下错误,包导入不进来RetentionPolicy cannot be resolved to a variableElementType cannot be resolved to a variable@Retention和@Target都能导入进来,没办法只能手动导入包了import java.lang.annotatio...

2018-07-20 17:16:55 3090 1

原创 Leetcode 165. Compare Version Numbers

Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return -1;otherwise return 0.You may assume that the version strings are non-empty an...

2018-07-17 14:49:15 128

原创 173. Binary Search Tree Iterator

/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class BSTIte...

2018-07-11 15:14:21 252

原创 Leetcode 160. Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘ c...

2018-07-09 11:10:32 125

原创 Leetcode 167. Two Sum II - Input array is sorted

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers su...

2018-07-08 15:07:32 137

原创 Leetcode 863. All Nodes Distance K in Binary Tree

解法:便利所有除了目标节点分支的节点,标记他们的爸爸和自己是左是右。然后从目标节点向外便利。/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val...

2018-07-07 22:03:20 678

原创 Leetcode 139. Word Break 动态规划

解法参考:https://blog.csdn.net/yujin753/article/details/48010677Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-sepa...

2018-07-06 13:16:58 390

原创 Leetcode 151. Reverse Words in a String

public class Solution { public String reverseWords(String s) { String []v=s.split(" "); /* for(String x:v) { System.out.println(x); }*/ String ans=""; for(int i=v.length-...

2018-07-05 21:02:14 214

原创 Leetcode 138. Copy List with Random Pointer(深拷贝)

/** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL), ...

2018-07-05 12:48:12 131

转载 浅拷贝与深拷贝的区别

简单的来说就是,在有指针的情况下,浅拷贝只是增加了一个指针指向已经存在的内存,而深拷贝就是增加一个指针并且申请一个新的内存,使这个增加的指针指向这个新的内存,采用深拷贝的情况下,释放内存的时候就不会出现在浅拷贝时重复释放同一内存的错误!我列举一个例子来说吧:你正在编写C++程序中有时用到,操作符的重载。最能体现深层拷贝与浅层拷贝的,就是‘=’的重载。看下面一个简单的程序:class string{...

2018-07-05 10:08:53 129

空空如也

空空如也

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

TA关注的人

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