毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

计算机操作系统课程设计报告 第4页

更新时间:2008-5-8:  来源:毕业论文

存储器管理---动态分区分配算法的模拟

 

 head=head->next;

                head->forward=NULL;

                work=head;若图片无法显示请联系QQ752018766

                delete point2;

                return address;//分配成功,返回address

            }

            if(point1==rear)//如果是尾节点

            {

                address=rear->address;

                point2=rear;

                rear=rear->forward;

                rear->next=NULL;

                delete point2;

                return address;//分配成功,返回address

            }

            if(point1!=head&&point1!=rear)

            {

                address=point1->address;

                point2=point1->forward;

                bestnode * point3=point1->next;

                point2->next=point3;

                point3->forward=point2;

                delete point1;

                return address;//分配成功,返回address

            }

            若图片无法显示请联系QQ752018766

        }

            }

    if(point1==NULL)

    {

        return address;//没有合适的空间,分配不成功,返回1000

    }

}

//按空间大小递增建立链表

{

    if(head==NULL)

    {

        head=rear=work=new bestnode(size,address,NULL,NULL);

    }

    else

    {

        bestnode * point1=head;

        bestnode * point2;

        while(point1!=NULL)

        {

            if(size<=point1->size)

            {

                            if(point1==head)//如果是首部,则改动头指针

                {

                    point2->next=head;

                    head->forward=point2;

                    head=point2;

                    work=point2;

                }

                else//如果插入点在链中

                {若图片无法显示请联系QQ752018766

                    point2->forward=point1->forward;

                    point2->next=point1;

                    point1->forward->next=point2;

                    point1->forward=point2;

                }

                break;//插入完成,退出

            }

            else

            {

                point1=point1->next;//寻找下一个位置

            }

        }

        if(point1==NULL)//如果插入点在链尾,改动尾指针

        {

                      rear->next=point2;

            rear=point2;

        }

    }

}

//判断是否输出完节点

bool bestfit_link::over()

{

    if(work==NULL)

    {

        work=head;

        return true;

    }

    else

    {

        return false;

    }

}

//返回链表元素

Job bestfit_link::returnjob()

{

    bestnode * point1=work;

    Job pointNum;

    if(point1!=NULL)

    {

        pointNum.size=point1->size;

            }若图片无法显示请联系QQ752018766

    work=work->next;

    return pointNum;

}

#endif

上一页  [1] [2] [3] [4] [5] 下一页

计算机操作系统课程设计报告 第4页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。