0% found this document useful (0 votes)
13 views13 pages

C

The document introduces Data Structures and Algorithms (DSA), defining algorithms as well-defined instructions for problem-solving and data structures as organized storage for efficient data access. It distinguishes between linear and nonlinear data structures, providing examples such as arrays, queues, stacks, graphs, and trees. Learning DSA is emphasized as essential for programming, as it enhances understanding of data handling and algorithm efficiency.

Uploaded by

Althea Rhien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views13 pages

C

The document introduces Data Structures and Algorithms (DSA), defining algorithms as well-defined instructions for problem-solving and data structures as organized storage for efficient data access. It distinguishes between linear and nonlinear data structures, providing examples such as arrays, queues, stacks, graphs, and trees. Learning DSA is emphasized as essential for programming, as it enhances understanding of data handling and algorithm efficiency.

Uploaded by

Althea Rhien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

CS 131

INTRO TO
INTRODUCTION
TO DSA
DSA
Contents
Algorithm
Data Structures
CS 131
DS Types
Why learn DSA?
DEFINITION 1

ALGORITHM
In computer programming terms, an algorithm is
a set of well-defined instructions to solve a
particular problem. It takes a set of input(s) and
produces the desired output.
2
A good-quality algorithm:
3

Precisely Clear and Most effective in


defined input
and output
unambiguous
steps
solving
problems 4

Not written in Usable in any


5
computer code Prog. Language
EXAMPLES 1

ALGORITHM
FINDING THE LARGEST NUMBER AMONG
THREE NUMBERS
2

5
EXAMPLES 1

ALGORITHM
FINDING FACTORIAL OF A NUMBER
2

5
1

STRUCTURE
2

DATA
DEFINITION
4
Data structure is a storage that is used to
store and organize data. It is a way of
arranging data on a computer so that it can
be accessed and updated efficiently. 5
DEFINITION 1
Linear data structures elements are arranged in
sequence one after the other, which makes it easy
to implement. 2

LINEAR DS
EXAMPLES

ARRAYS QUEUE
4
STACKS

LINKED LIST
As complexity of the program increases, the linear data structures might
5
not be the best choice because of operational complexities.
NONLINEAR DS
DEFINITION 1
Nonlinear data structures elements are not in any
sequence. They are arranged in a hierarchical
manner where one element will be connected to
one or more elements. 2
EXAMPLES
3

4
GRAPHS TREES
Each node is called vertex and A tree is also a collection of vertices and
each vertex is connected to edges. But there can only be one edge
other vertices through edges. between two vertices.
5
1

WHY LEARN
2

Programming is all about data


4

DSA?
structures and algorithms.
• Data structures are used to hold data
• Algorithms are used to solve the
problem using that data 5
1

WHY LEARN
2

It also teaches you


4

DSA?
DSA gives you an the science of
insight into how evaluating the This enables you to
efficient it is to use efficiency of an choose the best of
each solutions. algorithm. various choices.
5
CS 131

Thank you!
CS 131

You might also like