- 博客(174)
- 资源 (4)
- 收藏
- 关注
原创 2.19-删除链表中大于mink且小于maxk的值;
typedef struct node{ int data; struct node*next;}Linklist;void Delete(Linklist &L,int mink,int maxk){ Linklist*p=&L,*q=NULL; while(p->next) { q=p; while(p->next->data
2012-05-05 22:52:07 4559 1
原创 2.16-从la中删除从i开始len个元素后,把删除的元素放到lb中的j位之前
Status DeleteAndInsertSub(LinkedList la,LinkedList lb,int i,int j,int len){ if(i<0||j<0||len<0)return INFEASIBLE; p=la;k=1; while(knext;k++;} q=p; while(knext;k++;} s=lb;k=1; while(knext;k++}
2012-05-05 20:00:05 1010
原创 2.15--连接链表ha和hb,用hc接收;
typedef struct node{ int data; struct node*next;}Linklist;Linklist* connect(Linklist&ha,Linklist&hb){ Linklist*p=&ha; while(p->next)p=p->next; p->next=hb.next; return &ha;}
2012-05-05 19:14:33 806
原创 2.14-实现Length(L)返回链表L的长度
typedef struct{ int elem[max]; int length;}Seqlist;int Length(Linklist &L){ int count=0; Linklist*p=L.next; while(p){count++;p=p->next;}; return count;}
2012-05-05 18:58:48 1806
原创 2.13 -实现Locate(L,x)返回x在链表中的位置
typedef struct node{ int data; struct node*next;}Linklist;typedef struct{ int elem[max]; int length;}Seqlist;int Locate(Linklist &L,int x){ int count=0; Linklist*p=&L; while(p) { if(p
2012-05-05 18:36:43 1875
原创 2.11-在顺序表va中插入x使仍然有序
typedef struct{ int elem[max]; int length;}Seqlist;void insert(Seqlist &va,int x){ int flag,i,j; if(va.elem[va.length-1]-va.elem[0]>=0)flag=1; else flag=-1; for(i=0;i<va.length;i++) { if(
2012-05-05 18:22:59 953
原创 表达示求值
#include#include#include#includeusing namespace std;int isopra(char ch);//判断是不是运算符。int priority(char ch);//判断优先权。void trans(char *in,char *out);//将字符串转换成后辍学表达式。int compute(char *chb);//计算int
2012-04-25 15:55:26 646
原创 HDU 1022 火车进出站问题
Problem ITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9733 Accepted Submission(s): 3539Problem DescriptionAs the new term
2012-04-25 11:19:49 9531
原创 HDU 2037 今年暑假不AC
今年暑假不ACTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12996 Accepted Submission(s): 6707Problem Description“今年暑假不AC?”“是的。”
2012-04-14 19:59:07 639
原创 HDU 1789 Doing Homework again!
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline Acmers Forum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Stat
2012-04-14 17:55:23 1141
原创 UVa OJ 回文词(401)
Palindromes A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string"ABCDEDCBA" is apalindrome because it is the same when the
2012-04-13 17:36:42 1656
原创 HDU-1035 ROBOT NOTION
Problem DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions
2012-04-02 17:36:14 759
原创 HDU 1042 N!
Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, output N! in one line.
2012-04-02 11:45:15 470
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人