Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
39 views

Week 1 - Introduction To Data Structure and Algorithms

The document introduces data structures and algorithms. It defines data structures as ways to store and organize data to facilitate access and modifications. It discusses primitive and non-primitive data structures, with linear and non-linear non-primitive structures like arrays, stacks, queues, linked lists, trees and graphs. Algorithms are defined as computational procedures that take inputs and produce outputs. Choosing the right data structures and algorithms is important for developing efficient software.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Week 1 - Introduction To Data Structure and Algorithms

The document introduces data structures and algorithms. It defines data structures as ways to store and organize data to facilitate access and modifications. It discusses primitive and non-primitive data structures, with linear and non-linear non-primitive structures like arrays, stacks, queues, linked lists, trees and graphs. Algorithms are defined as computational procedures that take inputs and produce outputs. Choosing the right data structures and algorithms is important for developing efficient software.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lecture 1: Introduction to Data Structure

and Algorithms
1. Introduction to DSA
1.1 Data structure
A data structure is a way to store and organize data in order to facilitate access and
modifications so that we can perform operations on these data in an effective way. No single
data structure works well for all purposes, and so it is important to know the strengths and
limitations of several of them.
Example: A list of numbers, a list of nodes, …
1.2 Types of data structures
There are 2 main types of data structures: Primitive (Built-in) data structures and Non-
primitive Data Structures (User Defined Data Structures)
- Primitive data Structures are also called Primitive Data Types. byte, short, int, float,
char, boolean, long, and double are primitive Data types And the set of operations that
can be performed on these data are also predefined: addition, subtraction, division,
multiplication, …
- Non-primitive data Structures can be divided into two types:
- The elements arranged in a linear fashion are called Linear Data Structures.
Here, each element is connected to one other element only. Linear Data
Structures are as follows: String (in fact, String will be stored as an array of
chars so it is linear), Arrays, Single dimensional Array, Multidimensional
Array, Stack, Queue, Linked List, Singly-linked list, Doubly Linked list,
Circular Linked List.
- The elements arranged in a non-linear fashion are called Non-Linear Data
Structures. Here, each element is connected to n-other elements. Non-Linear
Data Structures are as follows: Trees, Binary Tree, Binary Search Tree, AVL
Tree, Red-Black Tree, Graph, Heap, MaxHeap, MinHeap, Hash, HashSet,
HashMap.
Types of Data Structures
1.2 Algorithm
Informally, an algorithm is any well-defined computational procedure that takes some value,
or set of values, as input and produces some value, or set of values, as output or An algorithm
is thus a sequence of computational steps that transform the input into the output.
The algorithm is not the complete code or program, it is just the core logic of a problem so a
computer program is an instance or concrete representation, for an algorithm in some
programming language.
An algorithm possesses the following properties:
• It must be correct (An algorithm is said to be correct if, for every input instance, it halts
with the correct output.).
• It must be composed of precisely defined steps.
• The order of the steps must be precisely defined.
• It must be composed of a finite number of steps.
• It must terminate for all inputs.

Requirements for good software:


● Clean Design
● Easy maintenance
● Reliable (no core dumps)
● Easy to use
● Fast
-> Efficient data structures (some specific problem that will require specific data structure to
solve and make computer more effective)
-> Efficient algorithms can help reduce the time and the memory that it uses to solve a
problem.
A Good programmer needs the right tools (algorithm and data structure) to make the software
run properly and efficiently (The main idea is to reduce the space and time complexities of
different tasks.).
If you know the characteristics of one data structure in contrast to another you will be able to
make the right decision in choosing the right data structure to solve a problem.
Importance of Data Structure and Algorithm

You might also like