1. Introduction to Data Structures:
A Data Structure is easy and simply a way or method of organizing and storing data so it can be accessed
and worked with efficiently. It is the foundation of every software program.
Linear Structures: Items are in a straight line just like a list.
Non-Linear Structures: Items are connected in more complex ways just like a family tree.
2. Common Data Structures:
A. Arrays An array is a collection of items stored right next to each other in memory.
Benefit: Very fast to find exact item if you know its position.
Drawback: Difficult to change the size once it is created.
B. Linked Lists A series of connected "nodes." Each node contains your data and a "pointer" to the next
node in the sequence.
Benefit: Easy to add or remove items without resizing the whole list.
C. Stacks (LIFO) Just think of a stack of books. You add a book to the top and take it off from the top. This
is called "Last-In, First-Out."
D. Queues (FIFO) Just think of a line at a store. The first person to join the line is the first one served. This
is called "First-In, First-Out."
3. Advanced Structures (Non-Linear):
A. Trees Data organized in a hierarchy. It starts at a "Root" node and branches out into "Child" nodes.
Binary Search Tree: A special tree where everything on the left is smaller than the middle, and
everything on the right is larger. This makes searching very fast.
B. Graphs A collection of points (nodes) connected by lines (edges). Graphs are used to map out social
networks or the shortest route on a GPS map.
4. What is an Algorithm?
An algorithm is a set of step-by-step instructions to solve a specific problem in English language, To be a
good algorithm, it must:
1. Be Clear: Each step must be simple.
2. Have Input: It needs data to work on.
3. End: It must stop after a certain number of steps.
5. Sorting and Searching:
A. Searching
Linear Search: Looking through a list one by one until you find the item.
https://www.imagetotext.info/text-to-pdf 1/2