链表的可变参数构造与图的临接表实现 广度有限遍历-成都快上网建站

链表的可变参数构造与图的临接表实现 广度有限遍历

 
#include 
using namespace std;
typedef  struct node
{
  int x; 
  node*next;
  node(){next=NULL;}
}node;
typedef struct head
{
    int x;
    int count;
    node*head;
    //head(int xx,int cc,node* P=NULL){x=xx;count=cc;head=p;}
}head;

void InsertTail(node *head,int val)
{
	if(head == NULL)
		return ;
	node *tmp = (node *)malloc(sizeof(node)*1);
	tmp->next = NULL;
	tmp->x = val;
	while(head->next != NULL)
	{
		head = head->next;
	}
	head->next = tmp;
}



/* VS2008*/
void List(node *head,...)
{
	if(head == NULL) return ;
	char* p = (char *)&head+4;
	int n = *(int *)p;
	int x = 0;
	for(int i=0;i < n;++i)
	{
		p = p+sizeof(int);
		x = *(int *)p;
		InsertTail(head,x);
	}
	
}
void show(node*head)
{
  node *p = head->next;    
    while(p != NULL)
    {
        cout<x<<" ";
        p = p->next;
    }
    cout<q;
  vectorv;
   q.push(H[0]);
  while(!q.empty())
    {
   head h=q.front();
      node*p=h.head->next;
      while(p!=NULL)
       {
          if(find(v.begin(),v.end(),p->x)==v.end())
          {
            cout<x<<"   ";
            v.push_back(p->x);
            q.push(H[p->x]);
          }          
          p=p->next;
       } 
    q.pop();    
    }
 cout<

五角星  

创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都网站建设、成都网站设计、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的青岛网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

特别说明

这里的代码  anycodes编译不过

需要设计一个通用的可变参,初始化链表;


当前题目:链表的可变参数构造与图的临接表实现 广度有限遍历
本文URL:http://kswjz.com/article/gopeii.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流