sanmao0816
码龄13年
关注
提问 私信
  • 博客:108,601
    108,601
    总访问量
  • 79
    原创
  • 1,752,600
    排名
  • 9
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:四川省
  • 加入CSDN时间: 2011-09-20
博客简介:

道虽迩,不行不至;事虽小,不为不成

查看详细资料
个人成就
  • 获得11次点赞
  • 内容获得3次评论
  • 获得30次收藏
创作历程
  • 52篇
    2015年
  • 27篇
    2014年
成就勋章
TA的专栏
  • C陷阱与缺陷
    4篇
  • C专家编程
    5篇
  • C和指针
    9篇
  • H264学习笔记
    2篇
  • 数据结构
    7篇
  • 视频
    2篇
  • bug集
    1篇
  • UNIX网络编程
    10篇
  • UNIX环境高级编程
    11篇
  • 现代操作系统
    1篇
  • leetcode
    28篇
创作活动更多

HarmonyOS开发者社区有奖征文来啦!

用文字记录下您与HarmonyOS的故事。参与活动,还有机会赢奖,快来加入我们吧!

0人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

Remove Linked List Elements [leetcode]

Remove Linked List ElementsRemove all elements from a linked list of integers that have value val.Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6 Return: 1 –> 2 –> 3 –> 4 –> 5 题意: 删除给定的节点
原创
发布博客 2015.05.29 ·
591 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Contains Duplicate [leetcode] 判断数组中是否有重复的元素

Contains Duplicate题意:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false
原创
发布博客 2015.05.28 ·
1732 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

[leetcode](Add Binary C语言实现)

Add Binary Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”. 题意:求两个二进制字符串相加,并把结果保存为二进制字符串。 解题思路:动态申请一个数组用于保存相加后的二进制字符串,两个二进制相加有两种可能: 1
原创
发布博客 2015.04.21 ·
2052 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

[leetcode](Remove Duplicates from Sorted Array II C语言实现)

Remove Duplicates from Sorted Array II Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array A = [1,1,1,2,2,3],Your function should return
原创
发布博客 2015.04.20 ·
731 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[leetcode](Remove Duplicates from Sorted List II C语言实现)

Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example, Given 1->2->3->3->4-
原创
发布博客 2015.04.19 ·
827 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[百度2016实习 在线笔试 编程第一题 度度熊 C语言]

最粗暴的实现算法,没有考虑优化问题。#include<stdio.h>#include <string.h>int function(char *str);int main(){ int num,temp,i; char s[100][10002]; scanf("%d",&num); temp = num;i = 0; while(num--){
原创
发布博客 2015.04.19 ·
1303 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[leetcode](Gray Code 格雷码 C语言实现)

Gray Code The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequen
原创
发布博客 2015.04.19 ·
2954 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

[leetcode]Reverse Linked List II (反转链表值 C语言实现)

Reverse Linked List II Reverse a linked list from position m to n. Do it in-place and in one-pass.For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note: Given m, n
原创
发布博客 2015.04.18 ·
1051 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

[leetcode]Validate Binary Search Tree (判断有效二叉搜索树 C语言实现)

Validate Binary Search Tree Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less t
原创
发布博客 2015.04.17 ·
1551 阅读 ·
0 点赞 ·
0 评论 ·
3 收藏

[leetcode]Construct Binary Tree from Preorder and Inorder Traversal(根据前序、中序遍历确定一棵二叉树 C语言)

Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree. 题意:
原创
发布博客 2015.04.15 ·
1067 阅读 ·
1 点赞 ·
0 评论 ·
4 收藏

[leetcode]Convert Sorted Array to Binary Search Tree (有序数组转化为二叉搜索树 C语言)

Convert Sorted Array to Binary Search Tree Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 题意:给定一颗有序数组,求出二叉搜素树 解题思路:二叉搜索树满足的条件是:左子树<根节点<右子树 采用递归思路
原创
发布博客 2015.04.15 ·
662 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[leetcode]Construct Binary Tree from Inorder and Postorder Traversal (利用中序遍历和后续遍历确定一颗二叉树)

Construct Binary Tree from Inorder and Postorder Traversal Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.
原创
发布博客 2015.04.15 ·
773 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

读取一个字符串,输出它里面字符的所有组合

例如:abc,它的所有字符组合为a,b,c,ab,ac,bc,abc 对于这种类型的题,想到的第一思路就是采用递归进行求解。 首先我们申请一个与所求字符串一样大小的字符数组s,用于保存各个字符的组合。 对于abc这样字符串的进行递归实现: a,ab,abc,ac,b,bc,c 实现代码:#include <stdio.h>#include <string.h>int Recursion(
原创
发布博客 2015.04.12 ·
2178 阅读 ·
1 点赞 ·
1 评论 ·
0 收藏

给定一个数N,要求列出所有不大于N的素数

对于素数的定义,可以参考百度百科,素数(质数),除了可以被本身及1整除以外,不会再被其他数整除。典型的素数例如,2 3 5 7 11 13 17 19 23 …… 最简单的方法就是遍历这个整数m,遍历它可能存在的所有除数,例如对于11(1,2,3,4,5,6,7,8,9,10,11)只有1和11能被整除,所以判断11为素数,而对于12(1,2,3,4,5,6,7,8,9,10,11,12)可以被(
原创
发布博客 2015.04.12 ·
4521 阅读 ·
0 点赞 ·
1 评论 ·
3 收藏

[leetcode]Valid Sudoku(判断有效数独 C语言实现)

Valid Sudoku Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’.A partially filled
原创
发布博客 2015.03.30 ·
4261 阅读 ·
1 点赞 ·
0 评论 ·
8 收藏

[leetcode]Count and Say (伯爵说 C语言实现)

Count and Say The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, …1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read of
原创
发布博客 2015.03.30 ·
1694 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[leetcode]Length of Last Word (求最后一个单词的长度 C语言实现)

Length of Last Word Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.If the last word does not exist, return 0.Note
原创
发布博客 2015.03.30 ·
1053 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[leetcode]Climbing Stairs(爬楼梯 C语言)

Climbing Stairs You 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 distinct ways can you climb to the top? 题意:你去爬楼梯,需要爬n个台阶,你
原创
发布博客 2015.03.28 ·
3266 阅读 ·
1 点赞 ·
0 评论 ·
2 收藏

[leetcode]Remove Duplicates from Sorted List (删除有序节点的值重复的节点 C语言)

Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that each element appear only once.For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->
原创
发布博客 2015.03.28 ·
1210 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

[leetcode]Merge Sorted Array (两个有序数组的合并 C语言实现)

Merge Sorted Array Given two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additiona
原创
发布博客 2015.03.28 ·
844 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多