请问为什么经过冒泡排序后输出的仍是没排列的数列?

#include<stdio.h>
#include<stdlib.h>
#define False 0
#define TRUE 1
#define MaxSize 99999
typedef  int KeyType;
typedef  int DataType;
typedef int BOOL;
typedef int Status; 
typedef struct entry{
    KeyType key;
    DataType data;
}Entry;

typedef struct list{
    int n;
    Entry D[MaxSize];
}List;

void Swap(Entry* D,int i,int j)
{
    Entry temp;
    if(i==j)
        return;
    temp=*(D+i);
    *(D+i)=*(D+j);
    *(D+j)=temp;
}
void BubbleSort(List *list)
{
    int i,j;
    for(i=list->n-1;i>0;i--)
    {
    BOOL isSwap=False;
    for(j=0;j<i;j++)
    {
      if(list->D[j].key>list->D[j+1].key)
     {
       Swap(list->D,j,j+1);
       isSwap=TRUE;
     }
    }
    if(!isSwap)
        break;
    }
}
int main()
{   
    List L;
    int n,i,x;
    printf("请输入待排列数的数量:\n");
    scanf("%d",&n);
    printf("请输入待排列的数:\n");
    for(i=0;i<n;i++)
    {
        scanf("%d",&x);
        L.D[i].key=x;
        L.D[i].data=x;
    }
    BubbleSort(&L);    
    printf("排列后的数如下:\n");
    for(i=0;i<n;i++)
        printf("%d ",L.D[i].data);
    system("pause");
    return 0;
}

img

L.n没有初始化