- 博客(21)
- 资源 (12)
- 问答 (4)
- 收藏
- 关注
原创 217. 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 e
2017-09-29 21:37:26 394
原创 442. Find All Duplicates in an Array
题目描述:Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appeartwice and others appear once.Find all the elements that appear twice in this array.Could you do it with
2017-09-29 08:58:49 396
原创 374. Guess Number Higher or Lower
题目要求:We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the numb
2017-09-28 23:31:31 411
原创 110. Balanced Binary Tree
题目描述:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees ofevery node nev
2017-09-28 21:09:23 413
原创 折半查找
递归算法:int binarysearch(int *a,int key,int low,int high){ if(low>high) return 0; int mid = (low+high)/2; if(a[mid]==key) return mid; if(a[mid]>key) binarys
2017-09-28 21:01:51 387
原创 226. Invert Binary Tree
题目描述:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this original tweet by
2017-09-28 08:45:11 373
原创 404. Sum of Left Leaves
题目描述:Find the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 and 15 respectively. Re
2017-09-28 08:08:56 347
原创 637. Average of Levels in Binary Tree
题目描述:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]
2017-09-27 21:08:16 343
原创 671. Second Minimum Node In a Binary Tree
题目描述Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactlytwo or zero sub-node. If the node has two sub-nodes, then this
2017-09-27 19:50:12 336
原创 155. Min Stack
class MinStack {private: stack s1; stack s2;public: void push(int x) { s1.push(x); if(s2.empty()||x s2.push(x); } void pop() {
2017-09-23 22:14:48 326
原创 20.Valid Parentheses 栈的应用:括号匹配
十分简单的括号匹配,用栈来操作就可以了#define max_size 1000001class Solution {public: typedef struct SqStack{ int top; char data[max_size]; }Stack; void Init_Stack(St
2017-09-23 21:06:05 385
原创 485_Max_Consecutive_Ones_Easy.c
/*Given a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutive
2017-09-09 19:59:16 361
原创 476_Number_Complement
/*Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note: The given integer is guaranteed to fit within the range
2017-09-09 19:58:41 323
原创 461_Hamming_Distance
/*The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.*/#define max 1010
2017-09-09 19:56:07 358
原创 455. Assign Cookies
/*Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a
2017-09-09 19:53:50 381
原创 453. Minimum Moves to Equal Array Elements
/*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:[1,2,3]
2017-09-09 19:52:33 340
原创 441_ Arranging_Coins
/*441. Arranging CoinsYou have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given n, find the total number of full staircase rows
2017-09-09 19:50:19 353
原创 434_Number_of_Segments_in_a_String
/*Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.Please note that the string does not contain any non-printable characters.
2017-09-09 19:47:50 357
原创 414. Third Maximum Number
/*Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1:Input: [3, 2,
2017-09-09 19:44:34 399
bert-base-uncased
2024-08-19
EVA-GCN-main.zip
2021-07-01
biwi下载地址.txt
2020-05-05
300w-lp下载地址.txt
2020-05-05
python中文分词使用的中文文章
2019-03-10
Notepad++ tidy2 代码自动排序dll文件
2016-02-25
关于从数据库取出C代码并运行的问题
2016-05-11
jar里的函数如何调用?
2015-12-29
wamp图标是黄色,求解
2015-11-12
php echo无法显示输出
2015-11-09
TA创建的收藏夹 TA关注的收藏夹
TA关注的人