一级日韩免费大片,亚洲一区二区三区高清,性欧美乱妇高清come,久久婷婷国产麻豆91天堂,亚洲av无码a片在线观看

答案在風(fēng)中飄蕩抒情作文

時(shí)間:2025-11-13 08:12:57 1500字 我要投稿

答案在風(fēng)中飄蕩抒情作文范文

  1、OSI七層模型

答案在風(fēng)中飄蕩抒情作文范文

  2物理層3數據鏈路層4網(wǎng)絡(luò )層5傳輸層6會(huì )話(huà)層7表示層8應用層

  2、進(jìn)程間數據共享的方式三種

  文件映射

  共享內存

  信號

  匿名管道

  命名管道

  郵件槽

  剪貼板

  3、TCP/UDP區別

  4、打印數組的所有組合

  [cpp] view plaincopyprint?

  #include

  int n = 0;

  void swap(int *a, int *b)

  {

  int m;

  m = *a;

  *a = *b;

  *b = m;

  }

  void perm(int list[], int k, int m)

  {

  int i;

  if(k > m)

  {

  for(i = 0; i <= m; i++)

  printf("%d ", list[i]);

  printf(" ");

  n++;

  }

  else

  {

  for(i = k; i <= m; i++)

  {

  swap(&list[k], &list[i]);

  perm(list, k + 1, m);

  swap(&list[k], &list[i]);

  }

  }

  }

  int main()

  {

  int list[] = {1, 2, 3, 4, 5};

  perm(list, 0, 4);

  printf("total:%d ", n);

  return 0;

  }

  #include

  int n = 0;

  void swap(int *a, int *b)

  {

  int m;

  m = *a;

  *a = *b;

  *b = m;

  }

  void perm(int list[], int k, int m)

  {

  int i;

  if(k > m)

  {

  for(i = 0; i <= m; i++)

  printf("%d ", list[i]);

  printf(" ");

  n++;

  }

  else

  {

  for(i = k; i <= m; i++)

  {

  swap(&list[k], &list[i]);

  perm(list, k + 1, m);

  swap(&list[k], &list[i]);

  }

  }

  }

  int main()

  {

  int list[] = {1, 2, 3, 4, 5};

  perm(list, 0, 4);

  printf("total:%d ", n);

  return 0;

  }

  二進(jìn)制

  首先,把數組每一個(gè)元素用一個(gè)二進(jìn)位表示,例如:

  A B C D E

  1 1 1 1 1 ---> 于是它最多有11111(二進(jìn)制)種不重復組合(即31種)(不考慮順序--按樓主要求)

  于是,只要檢查從1到31這些數字的二進(jìn)位哪些是二進(jìn)制值1,就可以得出組合了。(位值為1的元素選取,位值為0的元素棄之)

  (轉自網(wǎng)絡(luò ))

  5、二叉樹(shù)的面積

  深度優(yōu)先搜索,廣度優(yōu)先搜索的實(shí)現

  [cpp] view plaincopyprint?

  #include

  #include

  #include

  #define TRUE 1

  #define FLASE 0

  #define OK 1

  #define ERROR 0

  #define INFEASIBLE -1

  #define OVERFLOW -2

  typedef int Status;

  typedef int TElemType;

  typedef struct BiTNode

  {

  TElemType data;

  struct BiTNode *lchild,*rchild;

  } BiTNode,*BiTree;

  Status CreateBiTree(BiTree &T)

  {

  TElemType e;

  scanf("%d",&e);

  if(e==0) T=NULL;

  else

  {

  T=(BiTree)malloc(sizeof(BiTNode));

  if(!T)

  exit(OVERFLOW);

  T->data =e;

  CreateBiTree(T->lchild );

  CreateBiTree(T->rchild );

  }

  return OK;

  }

  int max(int a[])

  {

  int max,i;

  max=a[0];

  for(i=1;i<20;i++)

  {

  if(max

  max=a[i];

  }

  return max;

  }

  int BiTreeWidth (BiTree T)

  {

  if(T==NULL)

  return 0;

  else

  {

  static int a[20]={0};

  static int i=0;

  a[i]++;

  i++;

  BiTreeWidth (T->lchild );

  if(T->lchild ==NULL)

  i--;

  BiTreeWidth (T->rchild );

  if(T->rchild ==NULL)

  i--;

  return max(a);

  }

  }

  #include

  #include

  #include

  #define TRUE 1

  #define FLASE 0

  #define OK 1

  #define ERROR 0

  #define INFEASIBLE -1

  #define OVERFLOW -2

  typedef int Status;

  typedef int TElemType;

  typedef struct BiTNode

  {

  TElemType data;

  struct BiTNode *lchild,*rchild;

  } BiTNode,*BiTree;

  Status CreateBiTree(BiTree &T)

  {

  TElemType e;

  scanf("%d",&e);

  if(e==0) T=NULL;

  else

  {

  T=(BiTree)malloc(sizeof(BiTNode));

  if(!T)

  exit(OVERFLOW);

  T->data =e;

  CreateBiTree(T->lchild );

  CreateBiTree(T->rchild );

  }

  return OK;

  }

  int max(int a[])

  {

  int max,i;

  max=a[0];

  for(i=1;i<20;i++)

  {

  if(max

  max=a[i];

  }

  return max;

  }

  int BiTreeWidth (BiTree T)

  {

  if(T==NULL)

  return 0;

  else

  {

  static int a[20]={0};

  static int i=0;

  a[i]++;

  i++;

  BiTreeWidth (T->lchild );

  if(T->lchild ==NULL)

  i--;

  BiTreeWidth (T->rchild );

  if(T->rchild ==NULL)

  i--;

  return max(a);

  }

  }

  另附:

  二叉樹(shù)高度、寬度、結點(diǎn)個(gè)數、葉子結點(diǎn)個(gè)數

  實(shí)現二叉樹(shù)寬度遞歸算法~

  #include

  using namespace std;

  typedef struct node

  {

  char data;

  int lab;

  struct node *lchild;

  struct node *rchild;

  }btree;

  int m=0;

  void ct(btree *&b,char *str)

  {

  btree *st[99],*p=NULL;

  int top=-1,k,j=0;

  char ch;

  b=NULL;

  ch=str[j];

  while(ch!='\0')

  {

  switch(ch)

  {

  case '(':top++;st[top]=p;k=1;break;

  case ')':top--;break;

  case ',':k=2;break;

  default:p=(btree *)malloc(sizeof(btree));

  p->data=ch;

  p->lchild=p->rchild=NULL;

  if(b==NULL)

  b=p;

  else

  {

  switch(k)

  {

  case 1:st[top]->lchild=p;break;

  case 2:st[top]->rchild=p;break;

  }

  }

  }

  j++;

  ch=str[j];

  }

  }

  void outbt(btree *b)

  {

  if(b!=NULL)

  {

  cout<data;

  outbt(b->lchild);

  outbt(b->rchild);

  }

  }

  btree *findchild(btree *b,char x)

  {

  btree *p;

  if(b==NULL)

  {

  return NULL;

  }

  else

  if(b->data==x)

  {

  cout<<"找到結點(diǎn)"<

  if(b->lchild==NULL)

  cout<<"左節點(diǎn)為空!"<

  else

  cout<<"左孩子為:"<lchild->data<

  if(b->rchild==NULL)

  cout<<"右孩子為空!"<

  else

  cout<<"右孩子為:"<rchild->data<

  return b;

  }

  else

  {

  p=findchild(b->lchild,x);

  if(p!=NULL)

  return p;

  else

  return findchild(b->rchild,x);

  }

  }

  int btreeheight(btree *b)

  {

  int lchildh,rchildh;

  if(b==NULL)

  return(0);

  else

  {

  lchildh=btreeheight(b->lchild);

  rchildh=btreeheight(b->rchild);

  return(lchildh>rchildh?(lchildh+1):(rchildh+1));

  }

  }

  int i=-1,a[20];

  void btreewide(btree *b)

  {

  if(b!=NULL)

  {

  if(b->lchild!=NULL)

  {

  i++;

  b->lchild->lab=b->lab+1;

  a[i]=b->lab+1;

  }

  if(b->rchild!=NULL)

  {

  i++;

  b->rchild->lab=b->lab+1;

  a[i]=b->lab+1;

  }

  btreewide(b->lchild);

  btreewide(b->rchild);

  }

  }

  void vernum(btree *b)

  {

  if(b!=NULL)

  {

  m++;

  vernum(b->lchild);

  vernum(b->rchild);

  }

  }

  int leafver(btree *b)

  {

  if(b==NULL)

  return 0;

  else

  if(b->lchild==NULL&&b->rchild==NULL)

  return 1;

  else

  return leafver(b->lchild)+leafver(b->rchild);

  }

  void main()

  {

  char *s;

  s="A(B(D,E(H(J,K(L,M(,N))))),C(F,G(,I)))";

  btree *bt;

  cout<<"將要創(chuàng )建的二叉樹(shù):"<

  ct(bt,s);

  cout<<"輸出二叉樹(shù):"<

  outbt(bt);

  cout<

  cout<<"H結點(diǎn)左右孩子結點(diǎn)值:"<

  findchild(bt,'H');

  cout<<"二叉樹(shù)的深度:"<

  vernum(bt);

  cout<<"二叉樹(shù)結點(diǎn)個(gè)數:"<

  cout<<"二叉樹(shù)葉子結點(diǎn)個(gè)數:"<

  bt->lab=1;

  btreewide(bt);

  int j,k,num,max=0;

  for(j=1;j<=i+1;j++)

  {

  num=0;

  for(k=0;k<=i;k++)

  if(a[k]==j)

  num++;

  if(max

  {

  max=num;

  }

  }

  cout<<"二叉樹(shù)寬度為:"<

  }

  實(shí)現二叉樹(shù)寬度遞歸算法~

  #include

  using namespace std;

  typedef struct node

  {

  char data;

  int lab;

  struct node *lchild;

  struct node *rchild;

  }btree;

  int m=0;

  void ct(btree *&b,char *str)

  {

  btree *st[99],*p=NULL;

  int top=-1,k,j=0;

  char ch;

  b=NULL;

  ch=str[j];

  while(ch!='\0')

  {

  switch(ch)

  {

  case '(':top++;st[top]=p;k=1;break;

  case ')':top--;break;

  case ',':k=2;break;

  default:p=(btree *)malloc(sizeof(btree));

  p->data=ch;

  p->lchild=p->rchild=NULL;

  if(b==NULL)

  b=p;

  else

  {

  switch(k)

  {

  case 1:st[top]->lchild=p;break;

  case 2:st[top]->rchild=p;break;

  }

  }

  }

  j++;

  ch=str[j];

  }

  }

  void outbt(btree *b)

  {

  if(b!=NULL)

  {

  cout<data;

  outbt(b->lchild);

  outbt(b->rchild);

  }

  }

  btree *findchild(btree *b,char x)

  {

  btree *p;

  if(b==NULL)

  {

  return NULL;

  }

  else

  if(b->data==x)

  {

  cout<<"找到結點(diǎn)"<

  if(b->lchild==NULL)

  cout<<"左節點(diǎn)為空!"<

  else

  cout<<"左孩子為:"<lchild->data<

  if(b->rchild==NULL)

  cout<<"右孩子為空!"<

  else

  cout<<"右孩子為:"<rchild->data<

  return b;

  }

  else

  {

  p=findchild(b->lchild,x);

  if(p!=NULL)

  return p;

  else

  return findchild(b->rchild,x);

  }

  }

  int btreeheight(btree *b)

  {

  int lchildh,rchildh;

  if(b==NULL)

  return(0);

  else

  {

  lchildh=btreeheight(b->lchild);

  rchildh=btreeheight(b->rchild);

  return(lchildh>rchildh?(lchildh+1):(rchildh+1));

  }

  }

  int i=-1,a[20];

  void btreewide(btree *b)

  {

  if(b!=NULL)

  {

  if(b->lchild!=NULL)

  {

  i++;

  b->lchild->lab=b->lab+1;

  a[i]=b->lab+1;

  }

  if(b->rchild!=NULL)

  {

  i++;

  b->rchild->lab=b->lab+1;

  a[i]=b->lab+1;

  }

  btreewide(b->lchild);

  btreewide(b->rchild);

  }

  }

  void vernum(btree *b)

  {

  if(b!=NULL)

  {

  m++;

  vernum(b->lchild);

  vernum(b->rchild);

  }

  }

  int leafver(btree *b)

  {

  if(b==NULL)

  return 0;

  else

  if(b->lchild==NULL&&b->rchild==NULL)

  return 1;

  else

  return leafver(b->lchild)+leafver(b->rchild);

  }

  void main()

  {

  char *s;

  s="A(B(D,E(H(J,K(L,M(,N))))),C(F,G(,I)))";

  btree *bt;

  cout<<"將要創(chuàng )建的二叉樹(shù):"<

  ct(bt,s);

  cout<<"輸出二叉樹(shù):"<

  outbt(bt);

  cout<

  cout<<"H結點(diǎn)左右孩子結點(diǎn)值:"<

  findchild(bt,'H');

  cout<<"二叉樹(shù)的深度:"<

  vernum(bt);

  cout<<"二叉樹(shù)結點(diǎn)個(gè)數:"<

  cout<<"二叉樹(shù)葉子結點(diǎn)個(gè)數:"<

  bt->lab=1;

  btreewide(bt);

  int j,k,num,max=0;

  for(j=1;j<=i+1;j++)

  {

  num=0;

  for(k=0;k<=i;k++)

  if(a[k]==j)

  num++;

  if(max

  {

  max=num;

  }

  }

  cout<<"二叉樹(shù)寬度為:"<

  }

  6、地圖的點(diǎn)的文字位置的確定

  1、掃描點(diǎn)附近的矩形鄰域內是否為空

  2改進(jìn):搜索算法

【答案在風(fēng)中飄蕩抒情作文】相關(guān)文章:

答案在風(fēng)中飄蕩作文09-03

答案在風(fēng)中飄蕩創(chuàng )新作文05-07

有關(guān)答案在風(fēng)中飄蕩征文(精選23篇)01-06

讓和平在風(fēng)中飄蕩作文04-04

答案在風(fēng)中飄蕩創(chuàng )新作文[精]06-29

最新答案在風(fēng)中飄蕩創(chuàng )新作文06-29

小學(xué)生答案在風(fēng)中飄蕩作文(精選24篇)12-30

答案在風(fēng)中飄蕩創(chuàng )新作文高中版03-05

讓和平在風(fēng)中飄蕩作文(精選18篇)09-12

答案在風(fēng)中飄蕩創(chuàng )新作文700字(通用12篇)07-11

  • 相關(guān)推薦
一级日韩免费大片,亚洲一区二区三区高清,性欧美乱妇高清come,久久婷婷国产麻豆91天堂,亚洲av无码a片在线观看