0% found this document useful (0 votes)
25 views22 pages

Day 1 - Intro To DSA

good find

Uploaded by

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

Day 1 - Intro To DSA

good find

Uploaded by

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

Data Structure

and Algorithms
Data Structures
Algorithms
Objectives
Course Description

Covers design, analysis and implementation of basic


data structures
Algorithms operating on data structures are also
covered.
Asymptotic analysis of algorithms and data
structures are also covered.
Course Contents

Introduction to Data Structures


Linked Lists
Stacks & Queues
Non-linear Data Structures
Algorithms (Searching & Sorting)
[Linear Search, Binary Search], [Bubble sort, Selection sort, insertion sort]

[Hashing], [Quick Sort, Heap Sort, Merge Sort]

Trees & Graphs


Prerequisite and assessment

Fundamentals of computer science


Assessment:
Mid Exam – 20%
Lab Exam – 20%
Assignment – 10%
Final Exam – 50%
Syllabus Programming Languages
 Either Java or Python can be used for practice and exam.

 Classes will be conducted using Java

 IDEs: Eclipse or NetBeans are fine.

 Data Structures and Algorithms are independent of any


programming language.
 Data structure and algorithms are general programming concepts
and once you are familiar with concepts you can work in any
language.
Syllabus Reading

 We will not have a single book, instead we will use


many books, websites, tutorials
 Books
 Data Structures and Algorithms in Java, 2nd edition, Robert Lafore
 Data Structures and Algorithms in Java, 6th edition, Michael T. Goodrich, Roberto Tamassia, Michael H.
Goldwasser
 Data Structures and problem Solving in Java, 4th edition, Mark Allen Weiss
 Data Structures and Algorithms in Python, Michael T. Goodrich, Roberto Tamassia, Michael H.
Goldwasser
 Data Structures and Algorithms Made easy in Java, Narasimha Karumanchi
Syllabus -warning

 If you don’t do the labs


 The assignments will be very hard
 The exams will be very hard
 You will not be able to work on your project

 Copying labs, project and the assignments will


result in –ve value 
DSA Lab 0 - Installation

 Installing (For Java users)


 Java (newest JDK preferred)
 Eclipse / NetBeans

 Installing (For Pythonians)


 VS code or PyCharm or Thonny

Running
 Manipulating Arrays
Introduction to Data Structures

• Discussion points:

Variables
Data Types
OOP Concepts (Object, class, inheritance, abstraction, inheritance, polymorphism, interface)
Data Structures
• Data structure is a particular way of storing and organizing data in a computer
so that it can be used efficiently.
• It’s a special format for organizing and storing data.
• A data structure is an arrangement of data in a computer’s memory (or
sometimes on a disk).
• Data structures include
• arrays,
• linked lists,
• stacks,
• binary trees, and hash tables, among others.
• Algorithms manipulate the data in these structures in various ways, such as
searching for a particular data item and sorting the data.
Why Data Structures
 Efficient Data Organization
Data structures provide efficient ways to organize and store data in a
computer's memory. By choosing appropriate data structures, you can optimize
the storage and retrieval of data, leading to improved performance and reduced
resource usage.
 Data Manipulation
Data structures offer various operations that allow for efficient manipulation of
data. For example, searching, sorting, inserting, deleting, and updating
elements can be performed more efficiently using specific data structures
tailored to these operations.
 Problem Solving
Many programming problems and real-world scenarios can be modeled and
solved more effectively using appropriate data structures. Different data
structures excel in different scenarios, and having a good understanding of
them enables you to choose the most suitable approach for a given problem.
 Algorithm Design
Data structures are closely tied to algorithm design. Efficient algorithms often
rely on the appropriate use of data structures to achieve optimal time and
space complexity. Understanding data structures helps in designing and
implementing algorithms that solve problems efficiently.
 Code Reusability
 Performance Optimization
Abstract Data Types(ADTs)
 Abstract Data Type: is an abstraction of a data structure which provides only
the interface to which a data structure must adhere to.

The interface does not give any specific details about how something should be
implemented or in what programming language.
E.g., ADT vs Implementation
List  Dynamic array or linked list
Queue  Linked List, Array, Stack
Map  Tree Map, Hash Map or Hash Table
 Roughly speaking, it’s a way of looking at a data structure: focusing on what it
does and ignoring how it does its job
What is a Data Structure in Java?
 Data structure refers to a data collection with well-defined operations and
behavior or properties.
 A data structure is a unique way of storing or organizing the data in computer
memory so that we can use it effectively.

 A data structure is an arrangement of data in a computer’s memory (or sometimes


on a disk).
DS types
 Based on the organization of elements,

Linear Data Structures –


Elements are accessed in a sequential order
Non-linear Data Structures –
 Elements are accessed in a non-linear order
Algorithms
 a finite sequence of instructions, each of which has a clear meaning and can be
performed with a finite amount of effort in a finite length of time

 Engineers use pseudocodes to first draft and describe algorithms


“somewhere between formatted English and computer program code”
Fundamental questions about algorithms
 What is it supposed to do? [specification]
 Does it really do what it is supposed to do? [verification]
 How efficiently does it do it? [performance analysis | efficiency]
 It takes a set of input(s) and produces the desired output.

For example:

An algorithm to add two numbers:

1. Take two number inputs

2. Add numbers using the + operator

3. Display the result


Examples of algorithms
 Searching algorithms
 Sorting algorithms
Types of notations for time complexity

You might also like