![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
GooseTree
正在学习C/C++/Java
展开
-
Remove Duplicates from Sorted Array
LeetCode No.26 Given asorted array, remove the duplicates in place such that each element appear onlyonce and return the new length. Do notallocate extra space for another array, you must do this in原创 2016-02-21 20:55:21 · 175 阅读 · 0 评论 -
Plus One
LeetCodeNo.66 Given anon-negative number represented as an array of digits, plus one to the number. The digitsare stored such that the most significant digit is at the head of the list. 用字符串原创 2016-02-21 21:06:08 · 185 阅读 · 0 评论 -
Palindrome Number
Determinewhether an integer is a palindrome(回文). Do this without extra space. Some hints: Couldnegative integers be palindromes? (ie, -1) If you arethinking of converting the integer to string,原创 2016-02-22 12:31:26 · 278 阅读 · 0 评论 -
Implement Stack using Queues
Implementthe 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() --Return wh原创 2016-02-26 11:34:41 · 198 阅读 · 0 评论 -
Minimum Depth of Binary Tree
Given abinary tree, find its minimum depth. The minimumdepth is the number of nodes along the shortest path from the root node down tothe nearest leaf node. 想来也简单。以先序遍历算法为例,设置一个最小深度变量,在每个叶子节点判原创 2016-02-26 16:38:11 · 194 阅读 · 0 评论 -
Intersection of Two Linked List
Write aprogram to find the node at which the intersection of two singly linked listsbegins. Forexample, the following two linked lists: A: a1 → a2 ↘原创 2016-02-27 19:00:35 · 188 阅读 · 0 评论 -
Sum of Two Integers
LeetCode No.371 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a = 1 and b = 2, return 3. 这道题目一拿到便想到用位运算,因为加法在计算机上的本质也就是位运算。但是翻译 2016-07-12 16:49:58 · 244 阅读 · 0 评论