尤克里里LK
尤克里里LK
全部文章
分类
C语言(59)
Java(3)
SSM项目(5)
力扣-刷题(2)
开发软件安装(1)
数据结构(24)
未归档(2)
经验贴(3)
面试题(1)
归档
标签
去牛客网
登录
/
注册
尤克里里LK的博客
现已保送至东北大学 人工智能方向硕士研究生。个人邮箱:liuke990205@163.com
全部文章
(共100篇)
字符串:实现void strCat(char *p,char *q)。
#include<stdio.h> #define N 10 void strCat(char *p,char *q) { while(*p!='\0') { p++; } while(*q!='\0'){ *p=*q; p++; q++; } *p='\0'...
2020-05-16
0
458
设计在链式结构上实现直接插入排序算法。
void straightinsertsort(lklist *&head) { lklist *s,*p,*q; int t; if (head==0||head->next==0) return; else{ for(q=head,p=head->next;...
2020-05-16
0
823
设计在链式结构上实现简单选择排序算法。
#include <stdio.h> #include <stdlib.h> #define N 10 typedef struct list { int data; struct list *next; }LNode; void simpleselect...
2020-05-16
0
748
链表:设计在单链表中删除值相同的多余结点的算法。
#include <stdio.h> #include <stdlib.h> #define N 10 typedef struct list { int data; struct list *next; }LNode; void deleteLike(L...
2020-05-16
0
649
二叉树:设计一个求结点x在二叉树中的双亲结点算法。
typedef struct node { int data; struct node *lchild,*rchild; } bitree; bitree *q[20]; int r=0,f=0,flag=0; void preorder(bitree *bt, char x) { ...
2020-05-16
0
2146
二叉树:设计判断两个二叉树是否相同的算法。
int judgebitree(bitree *bt1,bitree *bt2)//判断两个二叉树是否相同。 { if (bt1==0 && bt2==0)//两棵树对应位置都为空返回1 return 1; else if (bt1==0 || bt2==0 ||...
2020-05-16
0
711
二叉树:设计判断二叉树是否为二叉排序树的算法。
二叉排序树的特点:左子树根结点值<根结点<右子树根结点值,并且中序遍历二叉排序树时,得到的序列是一个严格递增的序列。所以我们可以以此来判断二叉树是否为二叉排序树。 设置一个比所有结点值最小值还小的一个值,与结点从小到大做判断即可。如果最小值比判断的值大,则说明不是二叉排序树;如果最小值比...
2020-05-16
1
1610
字符串:实现int strLen(char str[])。任意输入一个字符串,调用该函数可以计算输入字符串的实际长度。
#include <stdio.h> int Mystrlen(char str[]) { int len = 0, i; for (i=0; str[i]!=0; i++) { len++; } } int main() { char str[80]; int len...
2020-05-16
0
445
字符串:实现char *subStr(char *s,int n,int len)。
#include<stdio.h> //char p[20];//设置为全局变量 char *subStr(char *s,int n,int len) { static char p[20];//或者设置为静态变量 int i,j=0; while(n--){ s++;/...
2020-05-16
0
399
口袋有5种颜色的球,每次摸3种,求共多少种摸法以及每种的颜色。
#include<stdio.h> int main() { char a[5][10]={"red","yellow","blue","white","block"}; int i,...
2020-05-16
0
384
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页