# Data Structures in c

### Data Structures C language version of the question for answers, urgently!

#include <iostream>

#include <iomanip>

#include <string>

#include <vector>

# include <iostream>

using namespace std;

int main()

{

vector< vector< int > > Point; // node

int Point_Number;// Number of vertices

int point;

int sum=0;// Finding degree of entry

cin>> > Point_Number;

Point.resize(Point_Number);

for(int i=0; i<Point_Number; i++ )// Claim array space

{

Point[i].resize(Point_Number );

}

for(int i=0; i<Point_Number; i++ )// Initialize adjacency matrix N*N

{

for(int j=0; j<Point_Number; j++ )

{

p> Point[i][j]=0;

}

}

for(int i=0;i<Point_Number;i++ )

{

Point[Rear-1][Head-1]=1;// Use 1 to represent an arc generated

}

cout<< “K=?” <<endl;

cin>>point;// vertex

for(int i=0; i<Point_Number; i++)

{

if( Point[i][point-1] ==1 )

{

sum++;// add one to the entry degree

}

}

cout<< “Sum=”<< sum<<endl;// output entry degree

return 0;

}

}

### c语言题型，数据结构题

#include<stdio.h>

#include<malloc.h>

typedefstructstudent

{

charname[20];

longnum;

charsex;

structstudent*pNext;

}Stu,*pStu;

voidcreatInfo(pStu*stu);

intdeletInfo(pStustu,longnumTemp);

voidprintInfo(pStustu);

intmain(void)

{

longnumTemp=0;

pStumyStu=NULL;

creatInfo(&myStu);

scanf(“%ld”,&numTemp);

if(1==deletInfo(myStu,numTemp))

printInfo(myStu);

return0;

}

voidcreatInfo(pStu*stu)

{

intn=1;

pStupNew=NULL,pTail=NULL;

*stu=(pStu)malloc(sizeof(Stu));

if(*stu==NULL)

return;

(*stu)->pNext=NULL;

pTail=*stu;

while(n<=10)

{

pNew=(pStu)malloc(sizeof(Stu));

if(NULL==pNew)

return;

pNew->pNext=NULL;

scanf(“%s”,pNew->name);

if(‘#’==pNew->name[0])

{

free(pNew);

pNew=NULL;

return;

}

scanf(“%ld%c”,&pNew->num,&pNew->sex);

pTail->pNext=pNew;

pTail=pNew;

++n;

}

}

intdeletInfo(pStustu,longnumTemp)

{

pTail=stu->pNext;

while(pTail)

{

if(pTail->num==numTemp)

{

free(pTail);

pTail=NULL;

return1;

}

pTail=pTail->pNext;

}

printf(“链表中唔该学生！\n”);

return0;

}

voidprintInfo(pStustu)

{

while(stu=stu->pNext)

printf(“%s,%d,%c\n”,stu->name,stu->num,stu->sex);

}