c로 쓴 reference(자료)구조론 연습문제 6장(그래프)
페이지 정보
작성일 23-02-15 03:01
본문
Download : 제6장 그래프.hwp
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
int insert_graph(node_pointer *headnode, int vertex1, int vertex2); /*make list*/
#include /*for malloc(), exit()*/
c로쓴자료구조론, 연습문제, 데이터구조, 6장, 그래프,
/*구조체 리스트 배열*/
void free_memory(node_pointer *ptr); /*memory해제 함수*/
<이석호 저>
순서
#define MAX_VERTICES 50 /*maximum size of vertex*/
다.
typedef struct node *node_pointer;
node_pointer inverse_graph[MAX_VERTICES];
node_pointer graph[MAX_VERTICES];
struct node {





/*node struct prototype*/
(b) 그래프를 위한 연결 인접 리스트를 만든다. (두 번 입력되는 간선은 없다고 가정)
c로 쓴 reference(자료)구조론 연습문제 6장(그래프)
레포트 > 공학,기술계열
void read_graph(node_pointer *headnode); /*input from user*/
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
}node;
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
#include
c로 쓴 reference(자료)구조론
void print_graph(node_pointer *graph); /*print lists*/
node_pointer link;
(c) 생성된 인접리스트를 이용하여 역 인접 리스트를 생성하라.
int main() {
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ c로 쓴 자료구조론 <이석호 저> <교보문고> 연습문제 6장 풀이입니다.
(a) 무방향 그래프를 위한 정점의 수와 간선들을 하나씩 읽어들인다.
int vertices; /*정점의 수*/
void inverse_adjacency_lists(int vertices); /*create inverse adjacency lists*/
(d) 인접 리스트와 역 인접 리스트를 인쇄하는 함수를 작성하라.
int vertex;
다음 사항을 위한 C함수를 작성하라.
Download : 제6장 그래프.hwp( 64 )
설명
<교보문고>
#define IS_FULL(ptr) (!(ptr)) /*determine available memory*/
연습문제 6장 풀이입니다.