Docsity

Slides on Data Structures and Algorithms, Slides of Data Structures and Algorithms

Partial preview of the text

Download Slides on Data Structures and Algorithms and more Slides Data Structures and Algorithms in PDF only on Docsity!

Data Structures and Algorithms

Dr Shola UshaRani

Associate Professor

SCOPE, VIT

Topics covered (broadly)

  • (^) Fundamental Data Structures
    • (^) Pointers, stacks queues, lists, trees, etc.
  • (^) Algorithms
    • (^) Writing Efficient Algorithms
    • (^) Algorithm Design Techniques
    • (^) Analyzing the performance of algorithms
  • (^) Algorithms in Graph Theory
  • (^) Complexity Classes.

Internal Components and Grading

  • (^) Theory (Relative Grading)
    • (^) CAT 1 (50 marks) (15%)
    • (^) CAT 2 (50 marks) (15%)
    • (^) Digital Assignments (1,2,&3) (10 marks) (30%)
    • (^) FAT (100 marks) ( 40%)
  • (^) Lab
    • (^) Ten to thirteen Lab sessions (100 marks)
      • (^) Each lab session might have one or more programming assignments

What is an Algorithm?

  • (^) A well defined computational procedure that takes some values as input and produces some value or a set of values as output .[CLRS] Eg.
  • Arranging athletes in increasing order of their height
  • Finding all red colored balls in a basket full of color balls

• May be specified

• In Natural Language(English)

• Or as a pseudo-code

Example

Write an algorithm to add two numbers entered by user.

  • (^) Start
  • (^) Read values num1 and num2.
  • (^) Sum = num1+num
  • (^) Print sum
  • (^) Stop Start and Stop need not be considered as a step

Writing an algorithm & Introduction to Algorithm

Analysis

Class-II

Dr Shola UshaRani

Associate Professor

VIT, Chennai Campus

Another example

Problem : Given a list of integers, arrange the integers in non-decreasing order of the values of the elements. Input: A sequence of integers Output: A re-ordering of the input sequence so that

Types of Algorithms

  • (^) Iterative
  • (^) Recursive

What constitutes a good algorithm?

  • (^) Identifying a suitable technique
    • (^) A clear logic / technique that will find a solution to the problem
    • (^) Some techniques include
      • (^) Divide and Conquer
      • (^) Brute force approach
      • (^) Recursion etc.

Note: Not all techniques can find a solution to a

problem.

What constitutes a good algorithm?

  • (^) An Efficient Design
    • (^) Identifying the appropriate data structures that support the technique being used.
    • (^) Representation of data
    • (^) Identifying suitable control statements / loops
  • (^) Efficiency of an algorithm eventually decides
    • (^) how long the algorithm takes to complete the task
    • (^) how much space it requires to go about the task.

Fundamentals of algorithm analysis, Space and

time complexity of an algorithm, Types of

asymptotic notations and orders of growth

Class III

Analysis of Algorithm

  • (^) In designing of Algorithm, complexity analysis of an algorithm is an essential aspect. Mainly, algorithmic complexity is concerned about its performance, how fast or slow it works.
  • (^) The complexity of an algorithm describes the efficiency of the algorithm in terms of the amount of the memory required to process the data and the processing time.
  • (^) Complexity of an algorithm is analyzed in two perspectives: Time and Space.