• C++ DoubleLinkedList


    C++ DoubleLinkedList

    For this assignment, create a class that represents a double linked list (forward and backward navigation), called DoubleLinkedList, of ints, that maintains a list in sorted order. The class should have the following operations:
    DoubleLinkedList() : Appropriately initializes the object.
    void insert(int value) : Inserts the value into the linked list, maintaining the sorted order.
    void merge(DoubleLinkedList absorbedList) : Absorbs the provided list into the current list, maintaining sorted order. The absorbed list will be empty at the end of this operation.
    void remove(int value) : removes an instance of the value provided from the list if it exists. If the value doesn’t exist, the remove request takes no action. If the value is in the list more than once, only one instance needs to be removed.
    const int& operator[](int index) const : Returns the value of the node in position index in the list. If the index is invalid, the operation throws an exception of type IndexOutOfBoundsException
    . You may declare the exception class in the header file for DoubleLinkedList. Note: Overloading [] in this way provides read, but not write, access to the array in a natural way.
    int getCount() const : returns the number of elements in the list
    void display(int reverse = false) const : this operation displays the linked list in forward order if reverse is false and reverse order if reverse is true.
    Your solution will be evaluated on the correctness of the header and implementation file. You are encouraged to also submit your main.cpp which should exemplify how you went about testing your class to ensure correctness.
    You must build the class manually (do not use templates in your solution) and you must use any global data.

    源码传送门

    传送门:https://pan.baidu.com/s/1JJs9vbZahUCB6cQvXLgAVg?pwd=1111

  • 相关阅读:
    数据结构之顺序表及其实现!
    Java实现基于RSA的数字签名
    CAS登录认证
    【数据结构】二叉树的实现
    C++ 性能优化指南 KurtGuntheroth 第7章 优化热点语句 摘录
    JS 防抖封装方法
    fastadmin tp 安装使用百度富文本编辑器UEditor
    简易node ts代码给json进行sort或者diff
    量子OFFICE之q6platform讲座:1-FileSystem
    每日一题(刷题记录)
  • 原文地址:https://blog.csdn.net/qq_35960743/article/details/127601815