leetcode
文章平均质量分 68
编程的小鱼
这个作者很懒,什么都没留下…
展开
-
leetcode之two sum
leetcode之two sum下定决心终于开始了leetcode之旅,先给自己打打气。 下面是two sum的问题 Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indi原创 2015-07-13 10:25:02 · 636 阅读 · 0 评论 -
Unique Binary Search Trees II
Unique Binary Search Trees IIGiven an integer n, generate all structurally unique BST’s (binary search trees) that store values 1…n.For example, Given n = 3, your program should return all 5原创 2017-10-29 00:41:03 · 155 阅读 · 0 评论 -
简单leetcode(五)
102. Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of its nodes’values. (ie, from left to right, level by level). For example: Given binary tree [3,9,20原创 2016-06-22 23:11:06 · 449 阅读 · 0 评论 -
简单的leetcode题(三)
Excel Sheet Column Number Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example:A -> 1B -> 2原创 2016-04-11 01:38:06 · 634 阅读 · 0 评论 -
leetcode之Add Two Numbers
感觉还不错,刷了两道,这一道算是给自己长点信心吧。 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numb原创 2015-07-13 15:06:08 · 258 阅读 · 0 评论 -
leetcode之Longest Substring Without Repeating Characters
刚开始没有啥别的办法用了一个最笨的方法,当然是时间超时。。。。int lengthOfLongestSubstring(char* s) { int length; int *index = (int *)malloc(sizeof(int) * strlen(s)); for (int i = 0; i < strlen(s); i++) for (int原创 2015-07-15 08:46:10 · 387 阅读 · 0 评论 -
leetcode之Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).两个排序好的数组,能想到的最好的方法是把两个原创 2015-07-17 10:35:09 · 284 阅读 · 0 评论 -
记第一次实习面试
更一篇实习面试总结最近由于春季学期的课程比较少,所以打算找个实习锻炼一下,目的不再挣多少钱,主要是能够通过进入公司中做些事情,锻炼一下写代码的能力,也通过面试的过程检查一下自己欠缺的地方,增长一下经验,为了明年能够顺利拿个可以拿得出手的offer。 打击是巨大的 我是从北邮和水木里面找的公司发的一些帖子,发了简历至少有10多个公司,到头来只有三家回复。。。。。。哎,这下就够打击的了。。。分析原创 2016-03-20 00:41:11 · 633 阅读 · 0 评论 -
Median of Two Sorted Arrays(2)
Median of Two Sorted Arrays(2)哎,自己真是个意志薄弱的人,一隔就是几个月的时间没有更新,原因也不过是因为这道题卡住了,对于算法方面的知识,自己深知还需要锻炼啊。废话少说,开始分析自己的原因吧,骚年。 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the m原创 2016-03-21 01:00:31 · 324 阅读 · 0 评论 -
Median of Two Sorted Arrays(3)
介绍discussion里面的不是findkth的算法,也当学习了这个算法是MissMary在leetcode的discussion里面讲述的,我在这儿翻译一下,也算学习了一下。正文中位数是用来干什么的?主要是用来把一个集合分成长度相等的两部分,其中左面的部分肯定要比面的部分小。把集合A随机分成两部分 | A[0], A[1], ... ,A[i+1] | A[i], A[i+2], ..原创 2016-04-05 21:14:25 · 280 阅读 · 0 评论 -
简单的leetcode(一)
invert binary tree Invert a binary tree. 4 / \2 7/ \ / \1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia: This problem was inspired by this origi原创 2016-04-05 21:37:02 · 874 阅读 · 0 评论 -
简单的leetcode题(四)
Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.把一个罗马数字转换成十进制,范围是1到3999为了编个程,把罗马有数字学了一遍。。。简单说一下罗马数字的构造规则 首先罗马数字由7个基本原创 2016-04-15 00:30:28 · 1039 阅读 · 0 评论 -
简单的leetcode(二)
Delete Node in a Linked List Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -> 4 and you原创 2016-04-06 23:30:33 · 581 阅读 · 0 评论 -
Find the Duplicate Number
Find the Duplicate NumberGiven an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only原创 2017-10-29 00:37:34 · 173 阅读 · 0 评论