C++中邻接表数据丢失

求帮忙看看,这段代码

我是的邻接图,初始化了100条长度为100的链表,然后将结构体数组从0到100的结点的指针分别指向这个这100条的头指针,问题在于:
在我完成随机写入数据后,再去遍历整个图,就会出现数据丢失的情况,完全遍历会有10000,但是实际上计数器只记录了4337个,

左边的数据读出来是99个,少了22340这个数据,请帮忙看看到底是哪里出了问题导致数据丢失

img

img

#include 
#include 
#include 
#include 
using namespace std;

class Node {
public:
    int vexNo;
    int index;
    int weight; // data
    Node* next; // pointer to next
};

struct head
{
    string vex;
    Node* next;
};

class List {
public:
    List(void) { head = NULL; } // constructor
    ~List(void); // destructor
    bool IsEmpty() { return head == NULL; }
    Node* InsertNode(int index, int weight, int vexNo);
    int FindNode(double x);
    void DisplayList();
    Node* conte(Node* urr);
    Node* head;
};

List::~List(void) {
    Node* currNode = head, *nextNode = NULL;
    while (currNode != NULL)
    {
        nextNode = currNode->next;
// destroy the current node
        delete currNode;
        currNode = nextNode;
    }
}


Node* List::InsertNode(int index, int weight, int vexNo) {
    if (index < 0) return NULL;
        int currIndex = 1;
    Node* currNode = head;
    while (currNode && index > currIndex) {
        currNode = currNode->next;
        currIndex++;
    }
    if (index > 0 && currNode == NULL) return NULL;
        Node* newNode = new Node;
        newNode->weight = weight;
        newNode->vexNo = vexNo;
    if (index == 0) {
        newNode->next = head;
        head = newNode;
    }
    else {
        newNode->next = currNode->next;
        currNode->next = newNode;
    }
return newNode;
}

void List::DisplayList() {
    int num = 0;
    Node* currNode = head;
    while (currNode != NULL){
    cout << currNode->weight << endl;
    currNode = currNode->next;
    num++;
    }
    cout << "Number of nodes in the list: " << num << endl;
}

ran(int sizes){
    int cont=0;
    struct head heads[1000];
    for(int k=0;k<1000;k++){
                std::stringstream ss;
                ss <<"ST"<str();
        heads[k].vex= result ;
    }

    int j=0;
    for(int i=0;ifor(int m=0;m"ST"<str();
            }
                 List result;
        for(j=0;jint weight = rand()%(99999-1+1)+1;
             int vexno  = rand()%(1000-1+1)+1;
              result.InsertNode(j,weight,vexno);
        }
        heads[i].next = result.head->next;
        result.DisplayList();
    }

        for(int i=0;iint num = 0;
        Node* currNode = heads[i].next;
        while (currNode != NULL){
        cout << currNode->weight << endl;
        currNode = currNode->next;
        num++;
        }
        cont+=num;
        cout << "Number of nodes in the list: " << num << endl;
    }

    cout << cont <int main(){
    int sizes = 100;
    ran(100);

}