Docsity

Data Structures and Algorithm Basic, Lecture notes of Algorithms and Programming

Partial preview of the text

Download Data Structures and Algorithm Basic and more Lecture notes Algorithms and Programming in PDF only on Docsity!

Data Structures

and Algorithms

L.S.K. UDUGAMA| CE

Contact Information

Dr. L.S.K. Udugama Department of Electrical and Computer Engineering The Open University of Sri Lanka Tel: Email: [email protected]

Learning outcomes

LO Outcome Expected 1 Define basic data structures such as stacks, queues, linked lists, and hash tables, and relevant standard algorithms for them. 2 Determine the advantages of various sorting algorithms by computer implementation of them. 3 Calculate the Big O of diverse non‐recursive algorithms and use it to compare efficiency. 4 Describe the dynamic‐programming paradigm and explain when an algorithmic design situation calls for it.

Learning outcomes cont…

LO Outcome Expected 5 Compare the various uses of Binary Search Trees, and Max/Min‐Heaps in different applications. 6 Construct the minimum weight, and shortest path spanning trees in a connected graph.

Outline Syllabus cont…

Topics 5 Binary Trees, Binary Tree Manipulation, Ordered Binary Trees, Binary Search Trees, Heaps and Priority Queues, AVL Trees, B Trees 6 Dijkstra’s Algorithm, Prim’s Algorithm, Kruskal’s Algorithm, Depth‐First vs Breadth‐First Search, Connected Components, Maximum Flow

Required Materials

  • Introduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein, Third Edition, MIT press, 2009
  • Algorithms in C++, Robert Sedgewick, Addison‐Wesley, 3rd edition, 1998 Reading Technology/Tools^ •^ Programming Languages

Assessment Criteria

 Take-home assignments  In-class quizzes  Mid Semester Examination  Final examination 10 10 60 20 Percent of Components Take-home assignments In-class quizzes Mid Semester Examination Final examination

Introduction to the course

 What is DSA?  A good algorithm usually comes together with a set of good data structures that allow the algorithm to manipulate the data efficiently  Do you need DSA?

 Examples

What I am going to do

 Guide you to design your own efficient algorithms and data structures for any problem  Develop your programming skills in order to use them in your field whenever necessary.

Data Structures and Algorithms

Data Structures

 What is a data structure (DS)?

 Logical way of storing data and

also defines the mechanism to

retrieve data

 Why do we need DS?

 Different data structures

What is an Algorithm?

 A set of mathematical instructions that must be followed in a fixed order, and that, especially if given to a computer, will help to calculate an answer to a mathematical problem (Cambridge Dictionary)  Well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output  A sequence of computational steps that transforms the input into the output  A well understood set of steps that leads to a goal state from initial state

Features of an Algorithm

 Must be correct  It always returns the desired output for all legal instances of the problem.  Constructed with a series of concrete steps  performable in a finite amount of time  No ambiguity  which step will be performed next  Consist of a finite number of steps  algorithm should not enter an infinite loop