The document outlines the course CSE-209 Algorithms-I, taught by Md. Rafsan Jani at Jahangirnagar University, focusing on the significance of algorithms in computer science, data structures, and algorithm efficiency. It includes a detailed course outline, assessment strategy, and recommended reading materials, along with a weekly schedule of topics to be covered. Key characteristics of algorithms and examples, such as sorting methods, are also discussed.
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 ratings0% found this document useful (0 votes)
11 views13 pages
LEC 1
The document outlines the course CSE-209 Algorithms-I, taught by Md. Rafsan Jani at Jahangirnagar University, focusing on the significance of algorithms in computer science, data structures, and algorithm efficiency. It includes a detailed course outline, assessment strategy, and recommended reading materials, along with a weekly schedule of topics to be covered. Key characteristics of algorithms and examples, such as sorting methods, are also discussed.
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
CSE-209
Algorithms-I
Lecture 1
Introduction
Md. Rafsan Jani
Assistant Professor Department of Computer Science and Engineering Jahangirnagar University Course Overview ● Objectives: – Understand the purpose and importance of algorithms in CS. – Learn fundamental concepts of DS and their role in algorithm design. – Analyze the efficiency of algorithms. – Explore real-world problems that can be solved using algorithms. ● Reading Materials : Lecture materials and reference books. ● Assessment Strategy: – Continuous Assessment (40%) • Attendance-10% • Class Tests-30% (3 MCQs/Written) – Final-60%
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 2
Course Outline Week # Date Class # Topics Remarks Sunday, January 5, 2025 Alumni Reunion 1 Tuesday, January 7, 2025 1 Introduction to Algorithms and Data Structures, Linear Search Sunday, January 12, 2025 2 Algorithms as a Technology, Selection Sort 2 Tuesday, January 14, 2025 3 Insertion Sort and Bubble Sort and Comparison of Sorting Algorithms Sunday, January 19, 2025 4 Introduction to Divide and Conquer, Binary Search 3 Tuesday, January 21, 2025 5 Merge Sort Sunday, January 26, 2025 6 Quick Sort 4 Tuesday, January 28, 2025 Shab-e-Mi’raj Sunday, February 2, 2025 7 Heap Sort CT-1 5 Tuesday, February 4, 2025 8 Linear Sorting Algorithms: Counting Sort, Radix Sort Sunday, February 9, 2025 9 Introduction to Greedy Algorithms, Task Scheduling, 6 Tuesday, February 11, 2025 10 Fractional Knapsack, Huffman Coding Sunday, February 16, 2025 11 Disjoint Set Union 7 Tuesday, February 18, 2025 12 Binary Search Tree Sunday, February 23, 2025 13 Introduction to Dynamic Programming 8 Tuesday, February 25, 2025 14 Rod Cutting and 0/1 Knapsack Problems Sunday, March 2, 2025 15 Coin Change Problem and Hill Climbing 9 Tuesday, March 4, 2025 16 Longest Common Subsequence (LCS) and Bit Masking CT-2 Sunday, March 9, 2025 17 Graph Representation, BFS 10 Tuesday, March 11, 2025 18 DFS, Topological Sort Sunday, March 16, 2025 19 Shortest Path Basics, Dijkstra's Algo 11 Tuesday, March 18, 2025 20 Negative weight cycles, Bellman-Ford Sunday, March 23, 2025 21 All Pair Shortest Path, Floyd-Warshall Algorithms 12 Tuesday, March 25, 2025 Eid-ul-Fitr Sunday, April 6, 2025 13 Tuesday, April 8, 2025 22 Minimum Spanning Trees, Prim's CT3 Sunday, April 13, 2025 23 Minimum Spanning Trees, Kruskal's 14 Tuesday, April 15, 2025 24 GCD, Modular Arithmetic, and Linear Equations
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 3
Google Classroom ● Class Code: eimy467 ● Link: https://classroom.google.com/c/NzQzNzAzOTMyMjQ3?cjc=eimy467
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 4
Reference Books 1. Introduction to Algorithms, 4th Edition — By Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (CLRS).
2. Intro. to the Design & Analysis of Algorithms, 3 rd Edition
— By Anany Levitin
3. Grokking Algorithms, 2nd Edition
— by Aditya Y Bhargava
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 5
Outline ● What are algorithms? ● Why is the study of algorithms worthwhile? ● What is the role of algorithms relative to other technologies used in computers?
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 6
What are algorithms? ● Informally, an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output in a finite amount of time. ● An algorithm is thus a sequence of computational steps that transform the input into the output. ● Example: – Recipe for baking a cake ● An algorithm for a computational problem is correct if, for every problem instance provided as input, it halts finishes its computing in finite time and outputs the correct solution to the problem instance. ● A correct algorithm solves the given computational problem. 21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 7 What are algorithms? ● Key Characteristics: – Input: An algorithm should accept well-defined inputs. • Example: A list of numbers for sorting. – Output: It must produce at least one output. • Example: The sorted list. – Finiteness: It must terminate after a finite number of steps. • Example: Sorting completes when all elements are in order. – Definiteness: Each step of the algorithm must be precisely defined. • Example: "Compare two elements" is a clear instruction. – Effectiveness: The operations must be basic enough to be performed with a finite amount of time and effort. • Example: Adding two numbers is an effective operation.
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 8
Recipe for baking a cake ● Example: Recipe for baking a cake 1. GatherIngredients(): - flour, sugar, eggs, butter, baking powder, additional flavorings (optional). 2. PreheatOven(temperature): - Set oven to 350°F (175°C). 3. PrepareBatter(): 4. PreparePan(): 5. PourBatter(): - Pour the prepared batter into the pan evenly. 6. Bake(): 7. CoolCake(): 8. DecorateAndServe():
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 9
Sorting Problem ● As an example, suppose that you need to sort a sequence of numbers into monotonically increasing order. ● sorting problem: – Input: A sequence of n numbers <5, 2, 4, 6, 1, 3>, – Output: A permutation (reordering) of the input sequence in increasing/decreasing order <1, 2, 3, 4, 5, 6>. ● Solutions: – Insertion Sort – Selection Sort – Bubble Sort – Merge Sort – Quick Sort – Heap Sort – Counting Sort 21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 10 Insertion Sort
Figure: Insertion Sort
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 11
Insertion Sort ● Pseudocode of insertion sort
21 January 2025 Md. Rafsan Jani, Assistant Professor, Dept. of CSE, JU 12