Overview of Data Structure and Algorithm
branch of computer science that deals with creating machine-efficient and optimized computer programs
optimize the codes in software engineering
building block of the software language (software development)
Stack Data Structure: like a pile of plates placed on top of each other. (element can be accessed only after accessing the previous elements)
Queue Data Structure: like boarding a bus (FIFO - first in first out; the person who first gets into queue is the one who firsts gets on the bus)
Graph Data Structure: in Social Media and Google Map (every user is a node that will exists an edge (connection) within one another)
Sorting Algorithm: to arrange books in a shelf (arranging items systematically)
Shortest Path Finding Algorithm: to find the shortest path in google map
Linear Data Structure
elements are arranged in one dimension, aka linear dimension
example: lists, stack, queue
Non-Linear Data Structure
elements are arranged in one-many, many-one, and many-many dimensions
example: tree, graph, table
collection of data items stored at a contiguous memory locations
elements are not stored at a contiguous location; the elements are linked using pointers
designed to use a special function called the Hash Function which is used to map a given value with a particular key for faster access of elements
a type (or class) for objects whose behavior is defined by a set of values and a set of operations
“abstract” because it gives an implementation-independent view
abstraction: process of providing only the essentials and hiding the details
data is generally stored in key sequence in a list which has a head structure consisting of count, pointers, and address of compare function needed to compare data in the list
the data node contains the pointer to a data structure and a self-referential pointer which points to the next node in the lis
instead of data being stored in each node, the pointer to data is stored
LIFO (Last In First Out)
follows basic design of the stack abstract data type
Abstraction: user does not need to know the implementation of data structure
Better Conceptualization of the real-world
Robust and has ability to catch errors