- 博客(21)
- 收藏
- 关注
原创 2021-08-27
跳台阶,用递归就可以跳好台阶int jumpFloor(int number ) { // write code here if(number<=1) return 1; return jumpFloor(number-1)+jumpFloor(number-2);}反转字符串#include<string.h>/** * 反转字符串 * @param str string字符串 * @return string字符串 */c
2021-08-27 22:46:18 74
原创 二分查找输出坐标
int search(int* nums, int numsLen, int target ) { // write code here int start=0; int end= numsLen-1; while(start<=end) { int mid=(start+end)/2; if(nums[mid]==target) { while(nums[mid-1]==nums[mid]
2021-08-27 18:00:08 91
原创 链表反转1
链表反转的一种最基础方式,用的是链表的头插进行的对链表进行赋值,然后进行头插struct ListNode* ReverseList(struct ListNode* pHead ) { // write code here struct ListNode*newhead=NULL; struct ListNode*cur=pHead; while(cur) { struct ListNode*next=cur->next;
2021-08-24 18:17:07 75
原创 堆的建立和应用
这个就是对堆进行了初始化和大堆小堆的排序堆的时间复杂度是logN所以在排序中起到了让大数据排序变快的作用以下是堆的排序建立包括堆的初始化小堆的搭建过程(大堆类似)堆的数据插入和数据排初#pragma oncetypedef int HPdatatype;#include<stdio.h>#include<stdlib.h>#include<string.h>//堆的建立 (小堆) 堆就是为了快速的找出来最小值void Swap(HPdata
2021-05-31 21:07:19 103 4
原创 2021-05-27
这个是栈的基本代码#include<stdio.h>#include<stdlib.h>#include<assert.h>//栈的作用//1.如果有后进先出的需求的函数typedef int datatype;typedef struct Stack{ datatype *_a; int _top; //栈顶 int _capticy;}Stack;//初始化void StackInit(Stack* pst){ assert(p
2021-05-27 18:04:27 43
原创 关于双向链表的基本建立
#pragma once#include<stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#pragma warning (disable:4996)typedef int SLDatatype;//结点typedef struct SListNode{ struct SListNode* prev; SLDatatype data; struct SLis
2021-05-26 18:13:04 75
原创 链表里的一些代码应用 反转链表 移除指定元素 返回链表的中间结点(遍历一次)输出倒数第k个结点(遍历一次) 合并两个有序链表
#pragma once#include<stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#pragma warning (disable:4996)typedef int SLDatatype;//结点typedef struct SListNode{ SLDatatype data; struct SListNode* next;}SListNode;
2021-05-16 16:46:16 75
原创 最详细最正确之链表的增删查改 让你一目了然无敌就完事
//头文件 有关于链表的初始化和设定#pragma once#include<stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#pragma warning (disable:4996)typedef int SLDatatype;//结点typedef struct SListNode{ SLDatatype data; struct SListNode
2021-05-14 20:54:55 82 1
原创 顺序表的练习
这个是关于顺序表的练习1.删除数组中的既定值2.还有进行数组的加法这个加法就可以在天文单位进行大数据的加法运算#include<stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include<assert.h>#include<windows.h>#pragma warning(disable:4996)typedef int hh;ty
2021-05-13 20:52:51 97
原创 有关顺序表的四种基础操作,头删尾删头插尾插
关于顺序表的增删查改,头删尾删头插尾插实现顺序表的四种基础操作//这个是头文件 SeqList.h#include<assert.h>#include<string.h>#include<assert.h>#include<windows.h>#pragma warning(disable:4996)typedef int hh;typedef int Datatype;//建立一个顺序表typedef struct Seqlist{
2021-04-22 17:21:33 225
原创 strcat的自定义
这个就是strcat字符串拼接函数的自定义#include<stdio.h>#include<windows.h>#pragma warning (disable:4996)char *mystrcat(char *dst, char csd){charstart = dst;while(*start){start++;}while (*start=*csd){start++;csd++;}return dst;}int main(){char
2021-03-22 16:11:04 311
原创 加油
**好久没有写代码了希望可以一点一点的进步**](https://img-blog.csdnimg.cn/20201103143352743.JPG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0x1Z2dhZ2VfbGJq,size_16,color_FFFFFF,t_70#pic_center)...
2020-11-03 14:39:09 61
原创 一些简单问题
1. 给定两个整形变量的值,将两个值的内容进行交换。2. 不允许创建临时变量,交换两个数的内容3.求10 个整数中最大值。4.将三个数按从大到小输出。![在这里插入图片描述](https://img-blog.csdnimg.cn/20191202092232356.JPG...
2019-12-02 09:53:31 185
原创 对未来的憧憬
自我简介我叫刘博俊现在还是一个大二的学生,现在还是一个对生活的迷茫刚刚有了目标的时候,在这个分叉路口选择了IT,选择不让自己的生活过的漫无目的,做一个有目标的人。对编程的目标我想经过漫长的学习和历练慢慢对c语言,c++,linux都很精通的人,可以独当一面的做编程,做软件。学习编程在有课余的时候就看看相关的书,每周抽出来至少3天的时间学习,看看相关的编程方法,有时间就做做编程的题(PT...
2019-11-28 19:32:39 222 3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人