0% found this document useful (0 votes)
13 views

Data Structure and Algorithm Reviewer

reviewer

Uploaded by

lanzharveyb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Data Structure and Algorithm Reviewer

reviewer

Uploaded by

lanzharveyb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Data Structure and Algorithm (DSA) - organize our data and use the most efficient Data

Structure
- Set of algorithms that organize data in a certain way

Data - Collection of numbers, symbols, and characte


- Raw and Unorganized

Information - organize
Data Structure – enables efficient access and modification ( ex : Disctionary, Supermarket,
Map )

Main goal of DSA - to minimize the time consumed by searching, sorting and writing data on
our system
Algorithm - set of instructions
Characteristics:
Input
Output
Unambiguity - clear and simple
Finiteness - limited
StructureEffectiveness - impact of every step
Flow:
Input, Process, Output

Algorithm complexity
A. Time complexity
B. Space complexity
- Factors to consider in Space complexity
1. Instruction size - executable program varies depending on number lines
code
2. Data space - store variables size
3. Environment space - store environment information

Asymptomatic Notation - A mathematical tool that calculates the required time…

- BIG-O(Worst case scenario)


- OMEGA(best case scenario)
- THETA(avarage complexity of an algorithm)

Variables - Temporary storage for data which stored in our RAM

Array - group of variables

Linear Data - arranged sequentially or linearly


Static Data Structure - easier to access but will consume memory (ARRAY)
Dynamic - can be updated during runtime
( QUEUE, STACK and lists)
Nonlinear - not arranged sequentially
- Branch of multiple Data

Array Data Structure


1. Reverse array - shifting elements of an array in reverse manner
2. Rotation array - circular shifting
3. Rearranging the array
4. Range queries in the array
5. Multidimensional array
6. Kadane’s algorithm
7. Dutch national flag algorithm

String - letters, numbers, symbols

1. Subsequence and substring - deleting one or more elements


2. Reverse and rotation in a string - interchanging postion so the first become last,
second become second last and so on.
3. Binary string - two types of characters
4. Palindrome - elements at a same distance from the center of the string are the same
5. Lexicographic pattern - dictionary order
6. Pattern searching - searching is searching a given pattern in a string

Linked List - less rigid in their storage structure and element usually are not sotred in
contiguous location

1. Single
2. Circular
3. Double - each has a extra pointer

Matrix - collection of number arranged in order of rows and columns

Stack - LI FO , FI LO
Operations :
push(), pop(), isEmpty(), isfull(), peek(), size()

Queue DS - FI FO , LI LO
Types : Circular, Double ended, Priority

Heap DS - Tree-based data structure, binary tree


Types : Max-heap, Min-heap
1. Max-heap - greatest among its child nodes
2. Min heap - smallest
Hash DS - genrating a file size output from an input
- Mathematical formulas known as has function

Tree DS -easy to navigate and search


Types : Binary, Ternary, N-ary tree, Complete Binary tree, Perfect “, Binary search tree

Graph DS - powerful tool


- Composed of a set vertices and set of edges
Types : Null, Trivial, connected, disconnected, Cycle, etc.

You might also like