The task: to create a class - a doubly linked list, to create a constructor, a destructor. Methods of working with the list: add, delete items, sort the list, search in it.
Sketched a small class structure, with C ++ almost not familiar, perhaps there is a more correct way to implement.
Is it correct to enter data directly in the designer? Or for this you need to create a private method and call it already?
struct tList { int key; tList * prev; tList * next; }; class List { private: tList * beginList; tList * endList; tList* getElement(void){ //выделение памяти //заполнение данных в структуре } public: List(){ //ввод данных в список //вызов addElement } void addElementEnd(){ //вызов getElement //добавление элемента в конец списка } void addElementBegin(){ //вызов getElement //добавление элемента в начало списка } void deleteElement(tList * element){ // удаление элемента } void sortAsc(){ // по возростанию } void sortDesc(){ // по убыванию } tList* searchElement(int key){ //поиск элемента } void printList(){ //печать списка } ~List(){ //освобождение памяти } };