- 博客(8)
- 资源 (11)
- 收藏
- 关注
原创 Java基本数据类型面试
在Java基本数据类型有8中,boolean、byte、short、int、long、char、float、double。每一种数据类型都有与其对应的对象类 1、首先先说明一下基本数据类型占用的字节数。如下: 简单类型 boolean byte char short int long float double void 占位数(1个字节8位) 1 8
2017-04-08 14:53:04 1181 1
原创 删除字符串中的空格
如题,例如“ a b c d “, 去除空格后变为”abcd”,要求时间复杂度为O(n)O(n),空间复杂度为O(1)O(1)。 * 那到这道题最开始想到的是用两个指针i,j,i指向第一个空格,j指向空格之后第一个不为空格的字符,然后交换,之后,i再寻找后边第一个等于空格的,j从i的后一个开始扫描。代码如下: public static void remove(char[] chs
2017-04-07 15:38:11 484
原创 LeetCode 215. 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. 解法一:该题
2017-04-02 18:21:13 202
原创 LeetCode 494:Target Sum
You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.Find out how many w
2017-04-01 16:29:49 245
原创 欢迎使用CSDN-markdown编辑器
Total HammingDistance –Leetcode. The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Now your job is to find the total Hamming distance be
2017-02-23 16:18:31 214
原创 LeetCode 112 Path Sum
题目要求 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary
2017-01-12 17:08:33 199
原创 Remove Element
题目描述: Given an array and a value, 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 in place with constant memory.Th
2017-01-02 20:37:45 198
原创 欢迎使用CSDN-markdown编辑器
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和图片上传 LaTex数学公式 UML序列图和流程图 离线写博客 导入导出Markdown文件 丰富的快捷键 快捷键 加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
2017-01-02 19:52:30 241
g2553与51通过nrf24l01双向通信
2014-07-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人