自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1002. A+B for Polynomials (25)

This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial

2016-12-14 08:59:19 187

原创 数据结构——堆排序和归并排序

这2种排序是几天前学的,现在把他们写在一起。 堆排序的思路: 1.a[0]是不参与排序的,可以先把a[0]设成-1 2.对数组进行一次整体的调整(可以从n/2往前调整,也可以从n往前调整,因为不满足j<=high时不调整) 3.调整函数里,让a[2*i]和a[2*i+1]比较,较大的数与a[i]交换 4.由于最大的数已经被调整到了a[1],所以将a[1]与数组最后一个数交换,同时最后一个数

2016-12-09 18:13:48 308

原创 数据结构——二分法查找

用二分法查找首先要将产生的一组随机数排序,然后调用二分查找函数。找到则输出这个数,找不到则输出错误信息。#include <stdio.h> #include <stdlib.h> #define N 100 #define ERROR -1void random_array(int a[],int n) { int i=0; for(i=0;i<n;i++)

2016-12-05 18:31:58 1098

原创 数据结构——快速排序

题目要求实现1000000内的数的快速排序。这里的方法用了多个数组,还有一种只用一个数组的方法。#include <stdio.h> #include <stdlib.h> #define N 1000000int a[N]; int a1[N]; int a2[N];void random_array(int a[],int n) { int i; for(i=0;i<n;i++)

2016-12-04 17:00:55 228

原创 数据结构——list

实现单链表的数据插入和删除。#include <stdio.h> #include <stdlib.h>typedef struct list{ int data; struct list* next; }List;void print_list(List* head) { while(head)//这里直接用head,因为这里只需要遍历链表 { pr

2016-12-03 14:05:27 318

原创 数据结构——栈

/*1.用数组栈实现括号匹配 input: ()()[][]{}{}  output:yes input([])  output:yes input:([)]  output:no 从main开始,刚开始没思路就从输入开始。 */ #include #include #include #define MAXSIZE 100 typedef stru

2016-11-28 22:30:06 213

空空如也

空空如也

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

TA关注的人

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