亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

蟲蟲首頁| 資源下載| 資源專輯| 精品軟件
登錄| 注冊

intersect

  • Line intersect get the nearest point.

    Line intersect get the nearest point.

    標(biāo)簽: intersect nearest point Line

    上傳時間: 2013-12-12

    上傳用戶:zjf3110

  • 并行環(huán)境下的intersect實(shí)現(xiàn)。使用mpi語言在smp環(huán)境下實(shí)現(xiàn)

    并行環(huán)境下的intersect實(shí)現(xiàn)。使用mpi語言在smp環(huán)境下實(shí)現(xiàn)

    標(biāo)簽: intersect mpi smp 并行環(huán)境

    上傳時間: 2016-10-08

    上傳用戶:hasan2015

  • 兩個鏈表的交集

    兩個鏈表的交集 #include<stdio.h> #include<stdlib.h> typedef struct Node{   int data;   struct  Node *next; }Node; void initpointer(struct Node *p){   p=NULL; } int  printlist(struct Node* head){   int flag=1;   head=head->next;   /*   因?yàn)闃?biāo)記1的地方你用了頭結(jié)點(diǎn),所以第一個數(shù)據(jù)域無效,應(yīng)該從下一個頭元結(jié)點(diǎn)開始   */   if(head==NULL)     printf("NULL\n");   else   {     while(head!=NULL)     {       if(flag==1)       {       printf("%d",head->data);       flag=0;       }       else       {         printf(" %d",head->data);       }       head=head->next;     }     printf("\n");   }   return 0; } struct Node *creatlist(struct Node *head) {      int n;    struct  Node *p1=(struct Node *)malloc(sizeof(struct Node));   p1->next=NULL; while(scanf("%d",&n),n!=-1) {   struct Node *pnode=(struct Node *)malloc(sizeof(struct Node));   pnode->next=NULL;      pnode->data=n;   if(head==NULL)     head=pnode;   p1->next=pnode;   p1=pnode; } return head; } struct Node *intersect(struct Node *head1, struct Node *head2) { struct Node *p1=head1,*p2=head2;/*我這里沒有用頭指針和頭結(jié)點(diǎn),這里是首元結(jié)點(diǎn)head1里面就是第一個數(shù)據(jù),一定要理解什么事頭指針, 頭結(jié)點(diǎn),和首元結(jié)點(diǎn) 具體你一定要看這個博客:http://blog.sina.com.cn/s/blog_71e7e6fb0101lipz.html*/ struct Node *head,*p,*q; head = (struct Node *)malloc(sizeof(struct Node)); head->next = NULL; p = head; while( (p1!=NULL)&&(p2!=NULL) ) { if (p1->data == p2->data) { q = (struct Node *)malloc(sizeof(struct Node)); q->data = p1->data; q->next = NULL; p->next = q;//我可以認(rèn)為你這里用了頭結(jié)點(diǎn),也就是說第一個數(shù)據(jù)域無效     **標(biāo)記1** p = q; p1 = p1->next; p2 = p2->next; } else if (p1->data < p2->data) { p1 = p1->next; } else { p2 = p2->next; } } return head; } int main() {   struct Node *head=NULL,*headt=NULL,*t;   //initpointer(head);//這里的函數(shù)相當(dāng)于head=NULL;  // initpointer(headt);//上面已經(jīng)寫了headt=NULL那么這里可以不用調(diào)用這個函數(shù)   head=creatlist(head);   headt=creatlist(headt);   t=intersect(head,headt);   printlist(t); }

    標(biāo)簽: c語言編程

    上傳時間: 2015-04-27

    上傳用戶:coco2017co

主站蜘蛛池模板: 河池市| 布尔津县| 德昌县| 腾冲县| 阿拉尔市| 宁安市| 吴桥县| 兰西县| 宝丰县| 泰宁县| 沁水县| 邵东县| 临城县| 靖宇县| 通城县| 沛县| 友谊县| 麦盖提县| 天门市| 汕头市| 拜泉县| 邯郸县| 渝北区| 洛隆县| 卢氏县| 宝应县| 罗定市| 昆明市| 太谷县| 临猗县| 扎囊县| 上林县| 苍南县| 夏邑县| 贺兰县| 杂多县| 天等县| 黄骅市| 江孜县| 璧山县| 邢台市|