随笔分类 -  Leetcode c语言

Leetcode c语言-Remove Nth Node From End of List
摘要:Title:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->... 阅读全文

posted @ 2017-09-17 19:07 sichenzhao 阅读(132) 评论(0) 推荐(0)

Leetcode c语言-4Sum
摘要:Title:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadrup... 阅读全文

posted @ 2017-09-17 13:01 sichenzhao 阅读(128) 评论(0) 推荐(0)

Letter c语言-Combinations of a Phone Number
摘要:Title:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (jus... 阅读全文

posted @ 2017-09-13 23:41 sichenzhao 阅读(451) 评论(0) 推荐(0)

对递归算法的理解
摘要:最近刷leetcode题时,碰到题目需要用到递归算法,否则基本无解。接下来结合实例谈谈本人对递归算法的理解。对递归算法的形象解释:想象用一本纯英文词典查单词,要查某一个单词的意思,翻到这个单词时,看解释,发现解释中有一个单词不认识,所以,无法明白这个要查的单词是什么意... 阅读全文

posted @ 2017-09-13 23:09 sichenzhao 阅读(189) 评论(0) 推荐(0)

Leetcode c语言-3Sum Closest
摘要:Title:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum ... 阅读全文

posted @ 2017-09-13 15:32 sichenzhao 阅读(214) 评论(0) 推荐(0)

Leetcode c语言-3Sum
摘要:Title:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array w... 阅读全文

posted @ 2017-09-13 15:15 sichenzhao 阅读(191) 评论(0) 推荐(0)

c语言-指针和字符串
摘要:1、 字符串的表示形式在C语言中,我们可以用两种方式访问字符串(1) 用字符数组存放一个字符串,然后输出该字符串。main(){ char string[]="I love China!"; printf("%s\n", string);}(2)... 阅读全文

posted @ 2017-09-12 14:55 sichenzhao 阅读(269) 评论(0) 推荐(0)

Leetcode c语言-Longest Common Prefix
摘要:Title:Write a function to find the longest common prefix string amongst an array of strings.这道题目不难,唯一要注意的是二重指针的使用,因为给了一个字符串数组,也就是一个二维数... 阅读全文

posted @ 2017-09-12 11:33 sichenzhao 阅读(474) 评论(0) 推荐(0)

Leetcode c语言-Roman to Integer
摘要:Title:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.这道题和上道题相反,将罗马数字转换成数字。两... 阅读全文

posted @ 2017-09-11 22:18 sichenzhao 阅读(126) 评论(0) 推荐(0)

Leetcode c语言-Integer to Roman
摘要:Title:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.这道题目就是将数字转换成罗马数字。比较简单。... 阅读全文

posted @ 2017-09-11 21:53 sichenzhao 阅读(129) 评论(0) 推荐(0)

Leetcode c语言-Container With Most Water
摘要:Title:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn s... 阅读全文

posted @ 2017-09-11 14:43 sichenzhao 阅读(99) 评论(0) 推荐(0)

Leetcode c语言-Palindrome Number
摘要:Title:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integ... 阅读全文

posted @ 2017-09-11 14:23 sichenzhao 阅读(131) 评论(0) 推荐(0)

Leetcode c语言-String to Integer (atoi)
摘要:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do... 阅读全文

posted @ 2017-09-10 21:45 sichenzhao 阅读(211) 评论(0) 推荐(0)

Leetcode c语言-Reverse Integer
摘要:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Note:The input is assu... 阅读全文

posted @ 2017-09-10 21:40 sichenzhao 阅读(137) 评论(0) 推荐(0)

Leetcode c语言-ZigZag Conversion
摘要:Title:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pa... 阅读全文

posted @ 2017-09-10 10:20 sichenzhao 阅读(429) 评论(0) 推荐(0)

Leetcode c语言-Longest Palindromic Substring
摘要:Title:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input... 阅读全文

posted @ 2017-09-09 11:55 sichenzhao 阅读(292) 评论(0) 推荐(0)

Leetcode c语言-Longest Substring Without Repeating Characters
摘要:Title:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "... 阅读全文

posted @ 2017-09-09 11:30 sichenzhao 阅读(135) 评论(0) 推荐(0)

Leetcode c语言-Add Two Numbers
摘要:Title:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each... 阅读全文

posted @ 2017-09-08 10:48 sichenzhao 阅读(395) 评论(0) 推荐(0)

Leetcode c语言-Two Sum
摘要:Leedcode上面的题对面试很有帮助,problem上的solutions也有很多,但都是java,python,c++,js等高级语言的解答,用c的很少,Leecode也是在不久前才增加了对c的支持,接下来本人开始对problem进行c语言解答。Title:Giv... 阅读全文

posted @ 2017-09-08 10:15 sichenzhao 阅读(351) 评论(0) 推荐(0)

导航