为什么结果只有一半,是哪里出的问题?

#include "List.h"
#include "LinkedList.h"
LinkedList::LinkedList()
{
head=NULL;
size=0;
}
LinkedList::~LinkedList()
{
Node *n;
for(int i=0;i<size;i++)
{
n=head;
head=head->next;
delete n;
}
}
void LinkedList::insert(int pos,int value)
{
int x=1;
Node *p=new Node(value);
Node *n=head;
if(size==0)
{
p->next=n;
n=p;
size++;
}
while(x<pos&&n!=NULL)
{
n=n->next;
x++;
}
p->next=n->next;
n->next=p;
size++;
}
void LinkedList::remove(int pos)
{
if(pos==0)
{
head=head->next;
size--;
}
int x=1;
Node *n=head;
while(x<pos)
{
n=n->next;
x++;
}
n->next=n->next->next;
size--;
}

int LinkedList::at(int pos)const
{
int x=0;
Node *n=head;
while(n!=NULL)
{
if(x==pos)
{
return n->data;
}
n=n->next;
x++;
}
return -1;
}
void LinkedList::modify(int pos,int newValue)
{
int x=0;
Node *n=head;
while(n!=NULL)
{
if(x==pos)
{
n->data=newValue;
}
n=n->next;
x++;
}

}
void LinkedList::disp(ostream&os)const
{
for(int i=0,n=getSize();i<n;++i)
{
os<<at(i)<<" ";
}
os<<endl;
}
#include "List.h"
#include "ArrayList.h"
ArrayList::ArrayList()
{
capacity=0;
data=new int[1008];
size=0;
}
ArrayList::~ArrayList()
{

}

void ArrayList::insert(int pos,int value)
{
capacity++;
size++;
for(int i=size-1;i>=pos;i--)
{
data[i+1]=data[i];
}
data[pos]=value;
}
void ArrayList::remove(int pos)
{
for(int i=pos;i<capacity;i++)
data[i]=data[i+1];
capacity--;
size--;
}
int ArrayList::at(int pos)const
{
return data[pos];
}
void ArrayList::modify(int pos,int newValue)
{
data[pos]=newValue;
}

img

img

img

img

img

img

main 函数呢,也不知道你接口调用顺序是什么