[code:1]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_NEIGHBOR 100
typedef struct _neighbor_list {
int distance;
char* hostport;
} NeighborList;
NeighborList *neighbor_list[MAX_NEIGHBOR];
int PrintList(int n);
int NeighborCompare(const void* n1, const void* n2);
int InsertNeighbor(NeighborList element);
int PrintList(int n);
int NeighborCompare(const void* n1, const void* n2)
{
NeighborList* _n1 = (NeighborList*)n1;
NeighborList* _n2 = (NeighborList*)n2;