![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
花开彼岸天x
这个作者很懒,什么都没留下…
展开
-
LeetCode 20 Valid Parentheses(括号匹配)
leetcode 20 括号匹配原创 2017-03-28 11:54:38 · 348 阅读 · 0 评论 -
leetcode 100. Same Tree
100. Same Tree 是不是同一棵树DescriptionGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally原创 2017-04-12 20:02:51 · 337 阅读 · 0 评论 -
leetcode 104. Maximum Depth of Binary Tree
104. Maximum Depth of Binary Tree 求二叉树的深度 c语言实现 DescriptionGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the lon原创 2017-04-17 18:34:22 · 439 阅读 · 0 评论 -
leetcode 28. Implement strStr()
[Leetcode 28] Implement strStr() 字串匹配,返回第一次出现的位置,C语言实现DescriptionImplement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of原创 2017-04-05 17:08:44 · 405 阅读 · 0 评论 -
leetcode 38. Count and Say
leetcode 38. Count and Say 计数和报数(c语言实现)DescriptionThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1原创 2017-04-05 19:44:17 · 271 阅读 · 0 评论 -
leetcode 101. Symmetric Tree
101. Symmetric Tree对称树判断c语言实现DescriptionGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3原创 2017-04-14 11:45:55 · 351 阅读 · 0 评论 -
leetcode 53. Maximum Subarray
53. Maximum Subarray c语言实现 DescriptionFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-原创 2017-04-06 14:44:42 · 412 阅读 · 0 评论 -
LeetCode 3.Longest Substring Without Repeating Characters c语言版
问题描述:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is原创 2017-07-15 17:35:47 · 2245 阅读 · 0 评论 -
找最外层点
这是头条内推的一道题目,事后写一个python版本问题描述:p 为给定二维平面整数点集,定义 p中某点x,如果x满足p中任意的点都不在x的右上方区域内(横纵坐标都大于x),则称其为“最大的”,求出所有“最大点”的集合,并按横坐标由小到大排好。如图中的点集,其中的实心点红色点就是要求的点# -*- coding:utf-8 -*-"""5(1,2)(5,3)(4,6)(7,原创 2017-08-23 10:40:37 · 6321 阅读 · 3 评论 -
leetcode 227. basic calculator 计算字符串表达式的值 python
227. Basic Calculator IIImplement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces原创 2017-09-06 16:46:39 · 1119 阅读 · 2 评论 -
最长公共子序列 python
注意:子序列和子串的区别,前者是字符串里的不相隔的字符组成的串,字符的先后顺序不变;后者是连续的字符组成的字符串实现下面的递推式,就实现了dp动归。更多图解的过程,可以参看博客http://blog.csdn.net/hrn1216/article/details/51534607class LCS: def findLCS(self, A, n, B, m原创 2017-09-26 08:38:22 · 1957 阅读 · 1 评论 -
十六进制以内任意进制之间的转换
/**m:源编码进制,m * n:代表目的编码,也是得小于16 * */#include void m2n(int m, char* mNum, int n, char* nNum){ int i = 0, tmp; char c, *p = nNum; //这是一个考察地方,是否能用最少乘法次数。 printf("%s\n", mNu原创 2017-10-18 22:28:29 · 534 阅读 · 0 评论 -
leetcode 88. Merge Sorted Array
88. Merge Sorted Array DescriptionGiven two sorted integer arrays nums1 andnums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space原创 2017-04-12 19:49:45 · 347 阅读 · 0 评论 -
LeetCode 9 palindrome (回文数)
[ LeetCode 9palindrome ]DescriptionDetermine whether an integer is a palindrome. Do this without extra space.eg 1234321 1221都是回文数,负数没有回文数#include#include#include#define原创 2017-03-23 10:32:05 · 303 阅读 · 0 评论 -
LeetCode 14 Longest Common Prefix C语言实现
[LeetCode 14]Longest Common Prefix DescriptionWrite a function to find the longest common prefix string amongst an array of strings.Sample["abca","aba","aaab"]output"原创 2017-03-27 10:49:05 · 1479 阅读 · 0 评论 -
leetcode 58. Length of Last Word
58. Length of Last Word DescriptionGiven a string s consists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If原创 2017-04-06 15:27:45 · 241 阅读 · 0 评论 -
leetcode 66. Plus One
66. Plus One(整数字符加一操作) c语言实现DescriptionGiven a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contai原创 2017-04-07 12:28:54 · 460 阅读 · 0 评论 -
[leetcode 7] Reverse Integer(整数反转) c函数实现
[leetcode 7]Description:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Note:The input is assumed to be a 32-bit signed integer. Your function sh原创 2017-03-22 18:58:22 · 2061 阅读 · 0 评论 -
Leetcode 13 Roman to Integer 罗马数字转成整数
Leetcode 13 Roman to IntegerDescriptionGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.罗马数字:罗马数字全是大写的字母I -- 1 V--5原创 2017-03-23 16:14:28 · 479 阅读 · 0 评论 -
leetCode26 Remove Duplicates from Sorted Array(移除多余的重复数组元素)
26. Remove Duplicates from Sorted ArrayDescriptionGiven a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate原创 2017-03-30 17:26:55 · 511 阅读 · 0 评论 -
leetcode 27 Remove Element(移除数组中的与val相等的元素)
27. Remove Element DescriptionGiven 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 arra原创 2017-03-31 16:53:31 · 833 阅读 · 0 评论 -
[LeetCode 21]Merge Two Sorted Lists 合并两个有序链表
[leetcode 21 ] Merge Two Sorted Lists c语言实现原创 2017-03-29 22:24:46 · 1077 阅读 · 0 评论 -
leetcode 69 sqrt(x)
69. Sqrt(x) 实现整数的平方根DescriptionImplement int sqrt(int x).Compute and return the square root of x.思路:使用牛顿切线法的方式来实现。假定要求整数n的平方根x,即 x^2 = n 。记成函数的方式就是f(x) = x^2 - n。先在点(x0,f(x0)原创 2017-04-10 16:52:42 · 362 阅读 · 0 评论 -
leetcode 2. Add Two Numbers C语言实现
leetcode 2. Add Two Numbers DescriptionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their n原创 2017-03-31 19:48:34 · 3889 阅读 · 0 评论 -
leetcode 70. Climbing Stairs
70. Climbing Stairs 爬楼梯问题DescriptionYou are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many disti原创 2017-04-10 18:11:20 · 405 阅读 · 0 评论 -
leetcode 83. Remove Duplicates from Sorted List
leetcode 83. Remove Duplicates from Sorted List DescriptionGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given 1->1->2, r原创 2017-04-11 17:14:25 · 366 阅读 · 0 评论 -
leetcode 4 Median of Two Sorted Arrays c语言实现
leetcode 4 Median of Two Sorted Arrays c语言实现原创 2017-07-18 16:08:36 · 864 阅读 · 0 评论