What is a linked cursor list? [C ++]

My professor provided me with a CursorList.cpp file that implements a "Linked Cursor List". The problem is that I don’t even know what it is!

Can anyone give me the gist of this?

Thank!

+3
source share
4 answers

According to this , here is some background in the linked cursor list:

  • some languages ​​do not support pointers
  • use arrays of objects instead
  • start with freelist
  • allocate space from freelist if necessary
  • delete: change pointers, add to freelists list

, , . , "" ?

+1

, , "" , , .

, , .cpp , .

+1

A CursorList - . , node, , node node. , 5, 3, 2, 11, 9 , 5 -> 3 -> 2 -> 11 -> 9 -> NULL. , , node, node NULL. , . ( malloc ) node .

CursorList, , . , listNode cursorList[10], listNode :

class listNode {
    public:
        listNode() {
            data = -1;
            next = NULL;
        }
        listNode(int inputData, &listNode inputNext) {
            data = inputData;
            next = inputNext;
        }
    private:
        int data;
        listNode* next;
};

listNode - : CursorList after insertions

, 5, next. , : CursorList with 5 removed

, , 5 next? , , Freelist ( @Justin Ethier). Freelist , . CursorList Freelist 0-9. listNode , Freelist . (, 5 ), . CursorList, next .

+1

, , .

C ++ , . . node, . , . , . , ,

0

Source: https://habr.com/ru/post/1740090/


All Articles