自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 习题2.8 输出全排列(深搜问题)

#include <stdio.h>#include<string.h>int Mark[10];int Element[10];void dfs(int n,int pcur){ if(pcur==n){//递归出口 for(int i=0;i<n;i++){ printf("%d",Element[i]);...

2019-09-16 00:16:40 363

原创 两个有序链表序列的合并

#include <stdio.h>#include <stdlib.h>/** 习题2.5 两个有序链表序列的合并 (15 分) * * L1和L2是给定的带头结点的单链表, *其结点存储的数据是递增有序的; *函数Merge要将L1和L2合并为一个非递减的整数序列。 *应直接使用原序列中的结点, *返回归并后的带头结点的链表头指针。 * */ty...

2019-09-14 13:46:08 299

原创 递归求简单交错幂级数的部分和

#include <stdio.h>#include <stdlib.h>#include <math.h>/* 习题2.6 递归求简单交错幂级数的部分和 * * 计算下列简单交错幂级数的部分和: * * f(x,n)=x−x^​2+x^3−x​^4+⋯+(−1)^n−1x^​n * */ double fn( double x, in...

2019-09-14 13:45:20 298

原创 寻找第K大的数

#include <stdio.h>#include <stdlib.h>#define SMaxSize 10000typedef int ElementType;typedef int Position;typedef struct Node *PtrToNode;struct Node{ ElementType Data[SMaxSize...

2019-09-11 22:22:03 324

原创 单向链表逆序

循环方式实现逆转链表关于如何逆转,过程分析,可以看单链表逆序,分析的超级好!还有一篇线性结构:单向链表的逆转 也很形象直观1、单链表逆转#include <stdio.h>#include <stdlib.h>typedef int ElementType;typedef struct Node *PtrToNode;struct Node{ ...

2019-09-09 18:56:49 418

原创 共用体

int main(){ union key{ int k; char ch[20]; }u; strcpy( u.ch, "C Programming"); printf( "u.ch : %s\n", u.ch); u.k=258; printf("%d\t%d\t%d\t",u.k,u.ch[0],u.c...

2019-09-08 16:52:35 429

原创 最大子列和(C语言+4种方法)

主函数:调用不同的函数,更改这句就OKmax=MaxSubseqSum4(A,N);int main(){ int N,A[100000],max; // printf("enter the number of the list N:\n"); scanf("%d",&N); // printf("enter the content of the lis...

2019-09-08 00:29:52 1210 2

原创 数据结构PAT 1.8 二分查找

Position BinarySearch( List L, ElementType X ){ ElementType maxindex=L->Last; ElementType minindex=1; ElementType center; while(maxindex>=minindex){ center=(maxindex+...

2019-09-07 23:51:11 209

原创 数据结构PAT 1.9 有序数组插入

浙江大学mooc数据结构PAT 1.9 有序数组插入@TOC功能快捷键撤销:Ctrl/Command + Z重做:Ctrl/Command + Y加粗:Ctrl/Command + B斜体:Ctrl/Command + I标题:Ctrl/Command + Shift + H无序列表:Ctrl/Command + Shift + U有序列表:Ctrl/Command + Shift...

2019-09-07 23:48:02 602

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除