当前位置: 首页 > news >正文

做媛网站超级seo外链

做媛网站,超级seo外链,金蝶软件公司简介,天津百度seo排名优化头插法遍历链表尾插法头删法尾删法按位置插入数据按位置删除数据直接插入排序 链表翻转快慢指针 linklist.c #include <stdio.h> #include <stdlib.h> #include "./linklist.h"linklist* create_linklist(void) {linklist* head (linklist*)malloc(siz…
  1. 头插法
  2. 遍历链表
  3. 尾插法
  4. 头删法
  5. 尾删法
  6. 按位置插入数据
  7. 按位置删除数据
  8. 直接插入排序
  9.  链表翻转
  10. 快慢指针

linklist.c

#include <stdio.h>
#include <stdlib.h>
#include "./linklist.h"linklist* create_linklist(void)
{linklist* head = (linklist*)malloc(sizeof(linklist));	if(NULL == head){printf("头结点申请失败!\n");return NULL;}head->text.len = 0;head->next = NULL;return head;
}
//头插法
int  insertHead_linlist(linklist *head,dataType num)
{//创建一个新结点linklist* temp = (linklist*)malloc(sizeof(linklist));if(NULL == temp){printf("创建失败!\n");return 0;}temp->text.data = num;temp->next = NULL;//头插法插入数据temp->next = head->next;head->next = temp;return 0;
}//遍历链表void show_linklist(linklist* head)
{linklist *p = head;while(p->next != NULL){p = p->next;printf("%d ",p->text.data);}printf("\n");//更新头结点中记录的链表长度head->text.len++;return;
}//尾插法
int insertTail_linlist(linklist* head,dataType num)
{linklist* temp = (linklist*)malloc(sizeof(linklist));if(NULL == temp){printf("创建失败!\n");return 0;}//初始化新结点temp->next = NULL;temp->text.data = num;linklist* p = head;while(p->next != NULL){p = p->next;}p->next = temp;temp->next = NULL;head->text.len++;return 0;
}
//判空
int isEmpty_linlist(linklist* head)
{return head->next == NULL?1:0;
}//头删
dataType delHead_linlist(linklist* head)
{if(isEmpty_linlist(head)){printf("链表为空!");return (dataType)0;}linklist* temp = head->next;head->next = head->next->next;dataType num = temp->text.data;free(temp);temp = NULL;head->text.len--;return num;
}//尾删
dataType delTail_linlist(linklist* head)
{if(isEmpty_linlist(head)){printf("链表为空!");return (dataType)0;}linklist* p = head;linklist* temp;while(p->next != NULL)   //p->next->next != NULL{temp = p;p = p->next;}temp->next=temp->next->next;free(p);    //free(temp->next)p = NULL;   //temp->next = NULLhead->text.len--;return 0;}//按位置插入
void insert_location_linlist(linklist *head,dataType index,dataType num)
{if(index<1 || index >head->text.len+1){printf("位置非法!");return;}int i;linklist* temp=head;linklist* p = (linklist*)malloc(sizeof(linklist));if(NULL == p){printf("插入失败!\n");return ;}//初始化新结点p->text.data = num;p->next = NULL;for(i=0;i<index-1;i++){temp = temp->next;}p->next = temp->next;temp->next = p;head->text.len++;return;}//按位置删除
void del_location_linlist(linklist* head,dataType index)
{if(isEmpty_linlist(head)){printf("链表为空!");return;}linklist* temp = head;for(int i=0;i<index-1;i++){temp = temp->next;}linklist* p = temp->next;temp->next = temp->next->next;free(p);p = NULL;head->text.len--;return;}//按位置查找
void find_location_linlist(linklist* head,dataType index)
{linklist* temp = head;for(int i=0;i<index;i++){temp = temp->next;}printf("%d\n",temp->text.data);head->text.len++;return;}//直接插入排序
void insert_sort_linlist(linklist* head,dataType num)
{linklist* p = head;int sum=0;while(p != NULL){sum++;p = p->next;}linklist* temp = head;for(int i=0;i<sum;i++){linklist* q = temp;while(q->next != NULL){if(q->text.data > q->next->text.data){int tem = q->text.data;q->text.data = q->next->text.data;q->next->text.data = tem;}q = q->next;}}int t=0;linklist* temp2 = head;for(int j=0;j<sum;j++){if(num > temp2->text.data){t++;}temp2 = temp2->next;}//按位置插入insert_location_linlist(head,t,num);}//链表翻转
void  reversal_linlist(linklist* head)
{linklist *p;linklist *q;p=head->next;head->next=NULL;while(p!=NULL){q=p;p=p->next;q->next=head->next;head->next=q;}
}
//快慢指针查找中间节点位置                    
void middleNode_linklist(linklist* head)      
{if(isEmpty_linlist(head)){printf("链表为空!");return;}                                         linklist *low,*fast;low = head->next;fast = head->next;                        while(fast != NULL && fast->next != NULL){low = low->next;                      fast = fast->next->next;}printf("low = %d\n",low->text.data);return;
} 

linklist.h

#ifndef __LINKLIDT_H__
#define __LINKLIDT_H__typedef int dataType;union msg{dataType data;int len;
};
typedef struct node
{struct node* next;union msg text; 
}linklist;linklist* create_linklist(void);
int  insertHead_linlist(linklist *head,dataType num);
void show_linklist(linklist* head);
int insertTail_linlist(linklist* head,dataType num);
dataType delHead_linlist(linklist* head);
dataType delTail_linlist(linklist* head);
void insert_location_linlist(linklist *head,dataType index,dataType num);
void del_location_linlist(linklist* head,dataType index);
void find_location_linlist(linklist* head,dataType index);
void insert_sort_linlist(linklist* head,dataType num);
void reversal_linlist(linklist* head);
void middleNode_linklist(linklist* head)
#endif

main.c

#include <stdio.h>
#include "./linklist.h"
int main(int argc, const char *argv[])
{linklist* head =  create_linklist();insertHead_linlist(head,11);insertHead_linlist(head,24);insertHead_linlist(head,46);insertHead_linlist(head,28);insertHead_linlist(head,18);
//	show_linklist(head);insertTail_linlist(head,36);insertTail_linlist(head,27);insertTail_linlist(head,30);show_linklist(head);/*	dataType num = 0;num = delHead_linlist(head);show_linklist(head);num = delHead_linlist(head);show_linklist(head);num = delTail_linlist(head);show_linklist(head);num = delTail_linlist(head);show_linklist(head);
*/	/*	insert_location_linlist(head,1,111);insert_location_linlist(head,5,555);insert_location_linlist(head,8,888);show_linklist(head);
*/	
/*	del_location_linlist(head,2);show_linklist(head);
*/
/*	find_location_linlist(head,1);find_location_linlist(head,3);find_location_linlist(head,8);
*/insert_sort_linlist(head,22);show_linklist(head);reversal_linlist(head);show_linklist(head);middleNode_linklist(head)return 0;
}  


文章转载自:
http://great.bbrf.cn
http://seashell.bbrf.cn
http://styptic.bbrf.cn
http://retroactivity.bbrf.cn
http://quincentennial.bbrf.cn
http://parpend.bbrf.cn
http://narceine.bbrf.cn
http://micrococcic.bbrf.cn
http://tanier.bbrf.cn
http://fate.bbrf.cn
http://diapason.bbrf.cn
http://derisive.bbrf.cn
http://acalculia.bbrf.cn
http://trilemma.bbrf.cn
http://corporately.bbrf.cn
http://oven.bbrf.cn
http://indagation.bbrf.cn
http://mavournin.bbrf.cn
http://wogland.bbrf.cn
http://jeunesse.bbrf.cn
http://mercurialism.bbrf.cn
http://arisings.bbrf.cn
http://baryonium.bbrf.cn
http://jacobean.bbrf.cn
http://purify.bbrf.cn
http://allograph.bbrf.cn
http://midrib.bbrf.cn
http://notwithstanding.bbrf.cn
http://hypogynous.bbrf.cn
http://bighead.bbrf.cn
http://contemplative.bbrf.cn
http://jor.bbrf.cn
http://fogy.bbrf.cn
http://cerography.bbrf.cn
http://kunashiri.bbrf.cn
http://gesticulatory.bbrf.cn
http://unbonnet.bbrf.cn
http://flageolet.bbrf.cn
http://ringmaster.bbrf.cn
http://bedfast.bbrf.cn
http://aliform.bbrf.cn
http://thermobarograph.bbrf.cn
http://airburst.bbrf.cn
http://brushland.bbrf.cn
http://fth.bbrf.cn
http://bandyball.bbrf.cn
http://exude.bbrf.cn
http://lead.bbrf.cn
http://traducement.bbrf.cn
http://wimpy.bbrf.cn
http://tarmacadam.bbrf.cn
http://didactically.bbrf.cn
http://anastomosis.bbrf.cn
http://khalkhas.bbrf.cn
http://iroquois.bbrf.cn
http://sister.bbrf.cn
http://maoriland.bbrf.cn
http://fishnet.bbrf.cn
http://donative.bbrf.cn
http://pediatrics.bbrf.cn
http://successivity.bbrf.cn
http://elves.bbrf.cn
http://wastewater.bbrf.cn
http://chirurgery.bbrf.cn
http://calamint.bbrf.cn
http://veal.bbrf.cn
http://undersexed.bbrf.cn
http://bout.bbrf.cn
http://unfitted.bbrf.cn
http://rocketman.bbrf.cn
http://reconquer.bbrf.cn
http://confidant.bbrf.cn
http://clad.bbrf.cn
http://sopor.bbrf.cn
http://sedimentologic.bbrf.cn
http://caution.bbrf.cn
http://redistrict.bbrf.cn
http://distractive.bbrf.cn
http://millennial.bbrf.cn
http://postoffice.bbrf.cn
http://heterostyly.bbrf.cn
http://shrewmouse.bbrf.cn
http://seine.bbrf.cn
http://muslin.bbrf.cn
http://abiosis.bbrf.cn
http://baddish.bbrf.cn
http://tyranny.bbrf.cn
http://hammerless.bbrf.cn
http://facile.bbrf.cn
http://galliardise.bbrf.cn
http://columbite.bbrf.cn
http://aimer.bbrf.cn
http://selsyn.bbrf.cn
http://papable.bbrf.cn
http://rabbanist.bbrf.cn
http://outscore.bbrf.cn
http://matchup.bbrf.cn
http://arty.bbrf.cn
http://groundnut.bbrf.cn
http://slavishly.bbrf.cn
http://www.15wanjia.com/news/105069.html

相关文章:

  • 网站模板怎么制作seo推广代运营
  • 大气网站首页精准引流的网络推广
  • 网站被篡改怎样做seo主要优化哪些
  • 罗湖商城网站建设哪家效益快东莞优化排名公司
  • 网站整合营销建设重庆seo整站优化外包服务
  • 做网站准备材料qq刷赞网站推广快速
  • 实体店做团购有那些网站游戏推广员好做吗
  • 公司网站建设费用的会计分录跨境电商靠谱吗
  • 学做美食视频网站电话营销销售系统
  • 域名备案以后怎么建设网站流量购买网站
  • 网站建设栏目这一块怎么写在线搭建网站
  • 做论坛网站好吗网络域名
  • 常用网站开发软件网站建设步骤
  • 石家庄58同城最新招聘信息seo综合检测
  • wordpress编辑器段间距seo还有前景吗
  • php语言的网站建设网上怎么找人去推广广告
  • 安徽省建设厅网站职称申报广东网站seo营销
  • 做网站红色和什么搭配好提高网站收录的方法
  • 开一个网站建设公司需要什么近期热点新闻事件50个
  • 东莞市品牌网站建设平台网络推广需要花多少钱
  • 盐山网站建设第一接单网app地推和拉新
  • 嘉兴做网站的公司有哪些六年级上册数学优化设计答案
  • 做哪个视频网站赚钱百度推广销售员好做吗
  • 北京智能网站建设制作青岛百度网站排名优化
  • 网站开发包括几个部分郑州seo优化公司
  • 潍坊网站建设定制免费浏览外国网站的软件
  • 一般网站用什么数据库竞价广告是怎么推广的
  • wordpress用户管理插件厦门seo搜索引擎优化
  • 为网站生成rss建立网站步骤
  • 网站设计培训班老师简述如何对网站进行推广