Professional Documents
Culture Documents
DSTRUCT
DSTRUCT
• Array
• Linked List
• Stacks
• Queue
• Tree
Arrays
Operation in an Array
1. Insert
2. Search
3. Delete
3. Multi-dimensional Array -
Searching
How to sort?
It uses two steps to execute over and over until data are
stored
- Compare the two items
- Swap the two items or copy one item but still; the data
are handled in different ways.
Insertion Sort
• Singly-linked list
• Doubly-linked list
Singly-linked lists
Basic part:
Data Pointer
The “next node” in the list is called SUCCESSOR. If a node is the last node
in the list, meaning it has no successor, the pointer would contain the
value NULL.
10 05 03 15
Martin Anabelle Bella Carlo
05 03 15 N
Right
Left Pointer Data
Pointer
1. Left pointer – contains the address of the previous node in the list.
2. Data Field – is used to contain the value of the element.
3. Right pointer – contain the address of the next node in the list.
The data field and the right pointer function in the manner as singly-linked
lists. If the node is the last node in the list, then the right pointer field
would contain the value NULL. The only new concept in a doubly-linked
list node is the left pointer field. It is used to contain the of the preceding
node in the list or what is known as the PREDECESSOR. If the node is the
first node in the list, this field will contain the value NULL since it has no
predecessor.
03 10 05
N X 10 03 Y 05 10 Z N
Traversal Operation