DSA Reviewer
ADVANTAGES OF LINKED LIST OVER ARRAYS
* Dynamic Array * Ease of Insertion/Deletion
DRAWBACKS OF LINKED LIST
* Random access is not allowed * Extra memory space for a pointer is required with each element of the list * Not cache friendly
ARRAYS LIMITATIONS
* The size of the array is fixed * Insertion of a new element/Deletion of existing element in an array of elements is expensive
CHARACTERISTICS OF GOOD ALGORITHM
1. Input and output should be well-defined. 2. Each step in the algorithm should be clear and definite, and 3. There should be an effective solution to a problem 4. Should be feasible with the available resources 5. An algorithm should have step-by-step directions, which should be independent of any programming code.
BASIC OPERATIONS OF LINKED LIST
Display Insertion Deletion Search
LIST
a collection of an ordered sequence of items
ALGORITHM
a finite set of instruction or procedures, written in order, to solve certain predefined task
LINKED LIST
a linear data structure that includes a series of connected nodes
NON-PRIMITIVE DATA STRUCTURE
a more complicated data structure and is derived from one or more primitive data structures.
DATA STRUCTURE
a storage that is used to store and organize data
DATA TYPE
a way to classify various types of data such as integer, string, etc. which determines the values that can be used to store the corresponding type of data
TIME COMPLEXITY
a way to signify the amount of time needed by the program to run to completion
DATA STRUCTURES
also known as data types
DATA STRUCTURE
an arrangement of data in a computer's memory in such a way that can be access quickly
PRIMITIVE DATA STRUCTURES
are basis for the discussion of a more sophisticated data structure
DATA (in data structures)
are processed by particular operations
ALGORITHM
can be stated as pseudocode
DATA
can exist in different forms; such as numbers and characters/text on pieces of paper, as bits and bytes stored in computer memory
PRIMITIVE DATA STRUCTURE
cannot be decomposed to other data structures
DATA STRUCTURE AND DATA TYPES DIFFERENCE
collection of data types arranged in a specific order
2 PARTS OF NODE
data content pointer field
TYPES OF DATA STRUCTURES
primitive and non primitive
DATA
raw facts stored in a person's mind
Node
record data structure
DATA
represent the overall resource of the organization
Nodes
stores the data and the address of the next node
ENVIRONMENT SPACE
the space necessary to store the environment information needed to start the suspended function
DATA SPACE
the space required to store all constants and variables value
INSTRUCTION SPACE
the space required to store the executable version of the program.
DATA
they are aggregated and summarized in various meaningful ways to form information
INSTRUCTION SPACE
this space is static but differs depending upon the number of lines of code in the program
POINTERS
used to store addresses of a variables
SECOND FUNDAMENTAL CONCERN
what operations will be performed on this data?
3 OPERATIONS OF POINTERS
1. define a pointer variable 2. assign the address of a variable to a pointer 3. locate the value at the address available in the pointer variable
3 SPACE IN ALGORITHM
Instruction Space Data Space Environment Space
TRAVERSAL
The operation of processing each element in the list is known as
HEAD
first node special name
FIRST FUNDAMENTAL CONCERN
how data will be stored
DATA STRUCTURE
is a type of data that can be categorized by its organization and operations that are defined on it
DATA STRUCTURE
is a way of collecting and organizing elements or items of data
ALGORITHM
is not a program, it is the main logic or solution to the problem
ALGORITHM
is said to be effective and fast if it takes a lesser amount of time to perform and consumes less memory space
SPACE COMPLEXITY
is the amount of memory space necessary by the algorithm, during the course of its execution.
LIST
may implement only a subset of the different operations
DATA STRUCTURE
must be seen in a logical concept that must address two fundamental concerns
SPACE COMPLEXITY
must be taken extremely for multi-user systems and in situations where limited memory is available
ALGORITHM
must solve complex problems using the following steps; * define the problem * design the algorithm to solve the problem