Data Structures and Algorithms: Introduction, Algorithms, Recursion, Sorting, Study notes of Data Structures and Algorithms

A part of the Master Informatique course materials, focusing on Data Structures and Algorithms. It covers the basics of algorithms, recursion, and sorting. Students will learn to distinguish between a problem and an algorithm, understand various algorithmic problem specifications, and analyze the efficiency and correctness of algorithms. The course is based on the book 'Introduction to Algorithms' by Cormen, Leiserson, Rivest, and Stein.

Typology: Study notes

2021/2022

Uploaded on 08/05/2022

nguyen_99
nguyen_99 🇻🇳

4.2

(80)

1K documents

1 / 71

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Master Informatique 1
Data Structures and Algorithms
Part 1 Introduction, Algorithms, Recursion, Sorting
Data Structures and Algorithms
Werner Nutt
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47

Partial preview of the text

Download Data Structures and Algorithms: Introduction, Algorithms, Recursion, Sorting and more Study notes Data Structures and Algorithms in PDF only on Docsity!

Data Structures and Algorithms

Werner Nutt

Acknowledgments

  • The course follows the book Introduction to Algorithms, by Cormen, Leiserson, Rivest and Stein , MIT Press [CLRST]. Many examples displayed on these slides are taken from their book.
  • These slides are based on those developed by Michael Böhlen for his course. (See http://www.inf.unibz.it/dis/teaching/DSA/)
  • The slides also include a number of additions made by Roberto Sebastiani and Kurt Ranalter when they taught later editions of this course (See http://disi.unitn.it/~rseba/DIDATTICA/dsa2011_BZ/)

DSA, Chapter 1:

  • Introduction, syllabus, organisation
  • Algorithms
  • Recursion (principle, trace, factorial, Fibonacci)
  • Sorting (bubble, insertion, selection)

Learning Outcomes

The main things we will learn in this course:

  • To distinguish between a problem and an algorithm that solves it
  • To get to know a toolbox of classical algorithms
  • To think algorithmically and get the spirit of how algorithms are designed
  • To learn a number of algorithm design techniques (such as divide-and-conquer)
  • To analyze (in a precise and formal way) the efficiency and the correctness of algorithms.

Literature

Cormen, Leiserson, Rivest and Stein (CLRS), Introduction to Algorithms , Second Edition, MIT Press and McGraw-Hill, 2001 and Third Edition, MIT Press, 2009 (See http://mitpress.mit.edu/algorithms/) Course is based on this book

Other Literature

Kurt Mehlhorn and Peter Sanders Algorithms and Data Structures - The Basic Toolbox Offers alternate presentation of topics of the course Free download from http://www.mpi-inf.mpg.de/~mehlhorn/ftp/Mehlhorn-Sanders-Toolbox.pdf

Assignments

The assignments are a crucial part of the course

  • Roughly each week an assignment has to be solved
  • The schedule for the publication and the handing in of the assignments will be announced at the next lecture.
  • A number of assignments include programming tasks. It is strongly recommended that you implement and run all programming exercises.
  • Assignments will be marked. The assignment mark will count towards the course mark.
  • Any attempt at plagiarism (copying from the web or copying from other students) leads to a 0 mark for all assignments.

Assignments, Midterm Exam,

Final Exam, and Course Mark

  • There will be
    • one written exam at the end of the course
    • one mock exam around the middle of the course
    • assignments
  • To pass the course, one has to pass the written exam.
  • Students who do not submit exercises and do not take part in the mock exam (or fail the mock exam) will be marked on the final exam alone.
  • For students who submit all assignments, and take part in the midterm, the final mark will be a weighted average 50% exam mark + 5% mock exam
  • 45% assignment mark

Organisation of Labs

  • You will attend always the lab of the same teaching assistant (TA) during the course
  • The TA will mark your assignments and be your first contact person for questions on the assignments
  • To help us organize the labs, send an email by Wednesday evening to [email protected] containing a group of students that would like to attend the same lab
  • One mail per group is enough
  • The mail should contain for each student of the group
    • name
    • email address
    • student number
  • All members of the group to be registered must appear in the cc

General Remarks

  • Algorithms are first designed on paper … and later keyed in on the computer.
  • The most important thing is to be simple and precise.
  • During lectures:
    • Interaction is welcome; ask questions (I will ask you anyway J )
    • Additional explanations and examples if desired
    • Speed up/slow down the progress

What are Algorithms About?

There are problems we solve in everyday life

  • Travel from Bolzano to Berlin
  • Cook Spaghetti alla Bolognese (I know, not in Italy,…)
  • Register for a Bachelor thesis at FUB For all these problems, there are
  • instructions
  • recipes
  • procedures, which describe a complex operation in terms of
  • elementary operations (  beat well …  )
  • control structures and conditions (  … until fluffy  )

Algorithms

Problems involving numbers, strings, mathematical objects:

  • for two numbers, determine their sum, product, …
  • for two numbers, compute their greatest common divisor
  • for a sequence of strings, find an alphabetically sorted permutation of the sequence
  • for two arithmetic expressions, find out if they are equivalent
  • for a program in Java, create an equivalent program in byte code
  • on a map, find for a given house the closest bus stop We call instructions, recipes, for such problems algorithms What have algorithms in common with recipes? How are they different?

Data Structures, Algorithms, and Programs

  • Data structure
    • Organization of data to solve the problem at hand
  • Algorithm
    • Outline, the essence of a computational procedure, step-by-step instructions
    • Specify transitions of the data structures
  • Program
    • implementation of an algorithm in some programming language

Overall Picture

Using a computer to help solve problems:

  • Precisely specifying the problem
  • Designing programs
    • architecture
    • algorithms
  • Writing programs
  • Verifying (testing) programs Data Structure and Algorithm Design Goals Implementation Goals Correctness (^) Efficiency Robustness Reusability Adaptability