A data structure is an abstract set of data, organised in an efficient way so that the data
contained in it can be manipulated to process or extract information.
2. A linear list may be inplimented by the use of pointers, what is a linear list and how
do pointers help to impliment it?
an ordered set of elements
The pointers tell the computer which piece of data to take mext or to which location
to add the mext piece of data.
3. What is a tree structure? why are tree structures important in computer science?
A tree structure is a hierarchial data structure. They allow searching to be completed faster,
data can be organised aphabetically and will allow the computer to run smother.
4.
5. What is the main difference between a tree and a binary tree?
the main difference is the fact that a tree can have several child nodes whereas a binary tree
can only have 2 child nodes.
6. (a) What is an ordered binary tree?
this is a tree that is put into a specific order in that information can be systematically
recieved or added.
(b) Why are ordered binary trees important?
They are important because infomation can easily be stored and recieved in a specific order
for example
7. Explain how a binary tree may be used to store data in alphabetical order.
A binary tree may be used easily to store data in alphabetical order. This is done by comparison
in that one piece od data is compared to the last. eg. if ur first letter starts with a letters
lower than the root, then it moves to the left of it and if it is grater than the root then it moves
to the right.
8.What is ment by the terms FIFO and LIFO
First In First Out.
Last In First Out.
9 (a) What is an alternative name for an LIFO data structure?
(b) What is an alternative name for an FIFO data structure?
An alternative name for an LIFO data structure is a stack
An alternative name for an FIFO data structure is a Que
10. Pointers play an important role when implementing queues and stacks. Explain the role of these
pointers when implementing each of these data structures.
In FIFO systems, pointers are used to indicate the start, or the head, of the que, and are also used
to indicate the end, or the footer, of the que. Queues are simple to use, but they must also be implemented
to work with data changes, so circular queues must be used. This simply means that the pointer must
move with the changes.
A LIFO works in the same way only that the pointer is chaged to the top of the stack so that the lsat one
in is always the first one out.

No comments:
Post a Comment