Data Structures and Algorithms Topic - 1 Flashcards
- is information such as facts and numbers used to
analyze something or make decisions. - is a piece of information, especially facts or
numbers.
Data
- is the arrangement of and relations between the parts or elements of something complex.
- It is constructed or arranged according to a plan; gives a
pattern or organization.
Structure
is a specialized format for organizing, processing, retrieving and storing data.
Data Structures
- is a set of instructions for solving a problem or accomplishing a task.
- act as an exact list of instructions that conduct specified actions step by step in either hardware- or software-based routines.
Algorithm
is a method of organizing data in a virtual system. Think of sequences of numbers, or tables of data: these are both well-defined data structures.
Data Structures
is a sequence of steps executed by a computer that takes an input and transforms it into a
target output.
Algorithm
5 Types of Data Structures and Algorithms :
- Linear Data Structure
- Nonlinear Data Structures
- Sorting Algorithm
- Searching Algorithm
- Graph Traversal Algorithm
are the simplest, arranging data on a single level.
Linear Data Structures
Types of Linear Data
Structures :
- Array
- Linked List
- Stack
- Queues
They contain multiple levels of data and do not connect elements sequentially.
Nonlinear Data Structures
Graphs consist of _____ and _____.
Nodes and Edges
The topmost node is the ____. Connected to the root are zero or more _________.
Root & Subtrees
are step-by-step procedures
for rearranging data in arrays and lists.
Sorting Algorithm
3 fundamental algorithms for sorting :
- Insertion Sort
- For small data sets that are
almost sorted, insertion sort is
an efficient way to finish the
job.
- For small data sets that are
- Merge Sort
- is ideal for organizing
linked lists.
- is ideal for organizing
- Quick Sort
- Large data sets benefit from
quick sort. It partitions an
array in two subarrays based
on a specified data element,
called the pivot.
- Large data sets benefit from
find and retrieve specific
elements from data structures.
Searching Algorithm
is a sequential searching
algorithm for sorted and unsorted data structures. It
traverses lists and arrays sequentially, one element at
a time.
Linear Search
Two key examples of Searching Algorithm :
- Linear Search
- Binary Search
- is an interval searching algorithm. Interval searches divide elements into multiple intervals and only traverse the expected interval. They are more efficient than sequential searches because they divide
the search space. - is efficient for finding
elements of a sorted list.
Binary Search
to search nodes in graphs
and trees.
Graph Traversal Algorithm
Two algorithms for traversing graphs are :
Breadth - First Search
- traverses the shortest
path between two nodes.
Depth - First Search
- searches graphs from top to
bottom.
In a tree with two levels of nodes, BFS would search
nodes from left to right in the following order:
- Tree Root
- Nodes to the First Level
- Nodes to the Second Level
There are three ways to apply DFS:
- Pre-Order Traversal
- ( root - leftChild - rightChild )
- In-Order Traversal
- ( root - leftChild – root - rightChild )
- Post-Order Traversal
- ( leftChild - rightChild - root )
store similar data elements at contiguous memory
locations, making it easy to process, sort, and search.
Array
is a series of data elements where each element
points to the next.
Linked List
is a collection of data elements that follows the
“last-in, first-out” (LIFO) rule.
Stack
are collections of data elements that follow
the “first-in, first-out” (FIFO) rule.
Queues