c语言
文章平均质量分 72
quliuwuyihmy
这个作者很懒,什么都没留下…
展开
-
字符指针与字符数组
字符指针定义及初始化: char *strs="Hello,world!"char *strs;str = "Hello,world!";字符串中的所有字符在内存中是连续排列的,strs指向的是字符串的第0个字符(从零开始);我们通常将第0个字符的地址称为字符串的首地址。字符串中每个字符的类型都是char,所以 str 的类型也必须是char *。访问方法:printf("%s\n",strs)原创 2017-07-22 14:45:46 · 473 阅读 · 0 评论 -
Leetcode-4. Median of Two Sorted Arrays
Description 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)).Example 1: nums1原创 2017-07-25 20:47:09 · 445 阅读 · 0 评论 -
LeetCode- 3. Longest Substring Without Repeating Characters
Description 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 “b”原创 2017-07-24 20:11:02 · 315 阅读 · 0 评论 -
指针与数组
二级指针与二维数组char *string[] ={“abc”,”abcd”,”acf”}; char string[3][4]={“abc”,”abcd”,”acf”}; ` 首先一点的是,虽然二维数组的数组名可以看做是一个指针,但是并不能将二维数组的数组名赋值给一个二级指针,也就是如下的代码int main(void){ int arr[3][3] = {{1,2,3},{4原创 2017-07-24 08:19:11 · 302 阅读 · 0 评论 -
LeetCode- 125. Valid Palindrome
DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is原创 2017-07-24 08:18:24 · 277 阅读 · 0 评论 -
LeetCode-551. Student Attendance Record I
Description You are given a string representing an attendance record for a student. The record only contains the following three characters:‘A’ : Absent. ‘L’ : Late. ‘P’ : Present. A student could原创 2017-07-24 08:18:01 · 299 阅读 · 0 评论 -
LeetCode-521. Longest Uncommon Subsequence I
Description Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defined as the longest subsequence of one原创 2017-07-24 08:17:38 · 251 阅读 · 0 评论 -
LeetCode-344. Reverse String
LeetCode-344. Reverse StringDescription Write a function that takes a string as input and returns the string reversed.Example: Given s = “hello”, return “olleh”.题目分析 本题要求返回所给字符串的逆序字符串。解决方法是直接逆序复制字符串原创 2017-07-24 08:17:07 · 217 阅读 · 0 评论 -
LeetCode-345. Reverse Vowels of a String
DescriptionWrite a function that takes a string as input and reverse only the vowels of a string.Example 1: Given s = “hello”, return “holle”.Example 2: Given s = “leetcode”, return “leotcede”.Note:原创 2017-07-24 08:16:30 · 388 阅读 · 0 评论 -
LeetCode-541. Reverse String II
Description Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characters left, reverse原创 2017-07-24 08:15:45 · 338 阅读 · 0 评论 -
LeetCode- 125. Valid Palindrome
DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is原创 2017-07-24 08:14:25 · 218 阅读 · 0 评论 -
LeetCode- 125. Valid Palindrome
DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is原创 2017-07-23 11:33:32 · 233 阅读 · 0 评论 -
LeetCode-459. Repeated Substring Pattern
Description Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of low原创 2017-07-22 22:40:59 · 251 阅读 · 0 评论 -
LertCode- 27. Remove Element
Description Given 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 array, you must do this in place with constant mem原创 2017-07-26 10:57:05 · 507 阅读 · 0 评论