Lists Flashcards
What data structure uses a linear list?
Array
What is meant by a linked list?
allow us to store items in whatever location is available
What is meant by a node?
an element of a list. It can hold many data items.
What is meant by a pointer?
A variable that stores an address of a node it is pointing to
What is meant by a null pointer?
A pointer that does not point to anything
What is meant by a StartPointer?
A variable that stores the address of the first element
How is a linked list modified?
By changing what the pointer. It copies into the new nodes pointer field the old content
Why are linked list used?
Real life applications (data is more than just a key field) and one data item. That is why linked lists are preferred over linear.
How do we reorder linked lists?
If we need to re-order a linked list, all we do is change the pointers that need to be moved.
What is a positive of using linked lists?
Saves time
What is the disadvantage of using linked lists?
Need more storage space for the pointer files
State the advantages of a binary tree
To allow people a faster search than a linear search or a searching a linked list as it is ordered.
Also when adding a new nod other nodes to not need to be moved, only a left or right pointer needs to be added to link the new node to an existing tree.
How can we store the binary tree?
In an array of records
What is a binary tree made up of?
A root node (start) A parent or child node A left subtree A right subtree Branches Terminal node