Data Structure
Data Structure
Data Structure
FINALS
STACK DATA STRUCTURE 19 - 22
HASH TABLES 60 - 69
MIDTERM QUEUE DATA STRUCTURE 23 - 27
Contents:
Definition of terms
Algorithm example
Pseudo codes
Example program
Output of the program
DEFINITION OF TERMS
Data: Collection of raw facts. Pseudo Codes – These are close to natural
languages that serve as a textual
Data Structure: is representation of the presentation of a flowchart.
logical relationship existing between
individual elements of data. Flowchart – It is a diagram that shows
step-by-step progression through a
operations. symbols.
ALGORITHM :
1. Display “Enter your age”
2. User will input an age from the keyboard
3. Create the condition
4. Display the result
PSEUDO CODES:
ARRAY CONCEPTS
Contents:
Definition of terms
Example program
Output of the program
DEFINITION OF TERMS
Array Array Length
A variable that stores the
Is defined as a set of finite
length of an array
number of homogenous
elements or same data
Syntax
items.
Index
The syntax is the same as
for a normal variable
declaration except the
A numeric value starts variable name should be
with zero (0). Each follow by subscript to
element can be accessed specify the size of
via its index dimension of the array
SAMPLE PROGRAM
CODES
SAMPLE PROGRAM
OUTPUT
PRELIM LESSON 3:
STORAGE ALLOCATION / ARRAY
WITH IMPLEMENTATION OF
LINKED LIST
Contents:
Definition of terms
Example program
Output of the program
DEFINITION OF TERMS
Key Next
Contains the data All the structure in the
parallel array
STACK Queue
Array
Implementation
Stack is an abstract data type that holds an An abstract data structure,
ordered, linear sequence of items. In contrast to a somewhat similar to Stacks.
queue, a stack is a last in, first out (LIFO) structure. Unlike stacks, a queue is open
A real-life example is a stack of plates: you can only at both its ends. The stack is formed by using
take a plate from the top of the stack, and you can the array.
only add a plate to the top of the stack.
Codes :
Output
MIDTERM LESSON 2:
Sequence - an array of elements, a maximum number of elements that the array may contain
its allocated size, and a logical length indicating how many of the allocated elements are valid.
Linear Data Structures - A data structure is said to be linear if its elements form a sequence.
Circular Buffer- is a data structure that uses a single, fixed-size buffer as if it were connected
end-to-end. This structure lends itself easily to buffering data streams.
Traversing Trees
Contents:
Definition of terms
Example program
Output of the program
DEFINITION OF TERMS
Graph Traversal
Refers to the process of visiting
(checking and/or updating)
Tree Traversal
each vertex in a graph.
is an algorithm that
puts elements of
a list into an order.
CODES
OUTPUT
SEMI-FINAL LESSON 3:
Also called an edge list, is one of the most basic and frequently used
representations of a network. Each edge in the network is indicated
Adjacency Lists by listing the pair of nodes that are connected.
CODES: ADJACENCY LISTS
OUTPUT: ADJACENCY LISTS
CODES: ADJACENCY MATRIX
OUTPUT: ADJACENCY MATRIX
FINAL LESSON 2:
HASH TABLES
Contents:
Definition of terms
Example program: (Add, Removing, Changing, Iterating Elements)
Output of the program
DEFINITION OF TERMS
Is a type of fast key lookup data structure that offers a flexible means
Mapping of indexing into its individual elements