Eman Samy Diyab

Lecturer
CS Department, Purdue University

MSc, Purdue University, Computer Science (2021)
BS, Ain Shams University, Computer Science

  • Email: E then my lastname AT Purdue DOT edu, OR my firstname AT Purdue DOT edu
  • Office: HAAS - G022
  • Office hours: Thursday 2:00 - 3:30 pm & Friday 11:00 - 12:30 pm

  • Previous Semesters

    Spring 2024 - CS15900

    Lecture # Date Lecture Quiz Notes Recording Pages Lab HW Keywords
    WEEK 1
    1
    Jan 9
    ---
    Pdf
    Video
    1 - 8
    Lab #0
    ---
    Introduction, course policies and motivations
    Watch Chapter #1: Part 1, Part 2 and Part 3
    2
    Jan 11
    Demo
    Pdf
    Video
    31 - 35
    Chapter 2: Structure of a C program, Commenting and Identifiers.
    WEEK 2
    3
    Jan 16
    1
    Pdf
    Video
    35 - 38
    Lab #1
    HW #1
    Chapter 2 cont.: Data types, Variables, Literal Constants, Symbolic/Defined Constants
    4
    Jan 18
    2
    Pdf
    Video
    39 - 43
    Chapter 2 cont.: Formatted I/O, Width and precision modifiers, Errors and debugging with examples
    WEEK 3
    5
    Jan 23
    3
    Part 0
    Part 1
    Part 2
    Part 3
    Part 0
    Part 1
    Part 2
    Part 3
    43 - 49
    Lab #2
    HW #2
    Chapter #3: Introduction & Announcements.
    Expressions(Operators and operands). Operator precedence. Simple & Compound assignments.
    Prefix and postfix (Undefined vs. Well-defined behavior example).
    Single and mixed data type expressions. implicit, explicit (type casting). Rounding, truncation using floor() & type casting to int
    6
    Jan 25
    4
    Pdf
    Video
    50 - 51
    Chapter #3 cont.: Lecture 5 revision.
    Assignment data type conversions.Truncation in printing using precision modifiers.
    Selection via calculation explained with the first examples.
    WEEK 4
    7
    Jan 30
    5
    Pdf
    Video
    51 - 55
    Lab #3
    Chapter #3 cont.: Selection via calculation explained with the first examples.
    Chapter#4: Purpose of functions. Motivation - why?
  • Factor: smaller is easier.
  • Reuse: by you or others. Remove redundancy.
  • Protect data: using the variable doesn't change its value.
  • Top-Down design. Factoring: Each function does a single task (functionally cohesive).
    Functions terminology: Call / calling / called / Return / Parameter passing.
    8
    Feb 1
    6
    Pdf
    Video
    55 - 61
    Chapter# 4: cont. Types of functions:
    1- No parameters - no return value: ex. welcome() , menu_options().
    2- No parameters - with return value: ex. get_input().
    3- With parameters - with return value - Many math.h fx, sin().
    WEEK 5
    9
    Feb 6
    7
    Pdf
    Video
    62 - 64
    Lab #4
    HW #3
    Chapter#4 cont. Types of functions. 4- With parameters - no return value - printf(), display_results(). What is permitted in main() Function - only local variable definitions, function calls and limited selection or repetition (to call functions).
    10
    Feb 8
    8
    Pdf
    Video
    64 - 68
    Chapter#4 cont. Parameter passing:
    1- Pass by address.
    2- Pass by address.
    Scope.
    WEEK 6
    11
    Feb 13
    9
    Pdf
    Video
    68 - 73
    Lab #5
    Chapter#4 cont. Structure Charts. How to read a structure chart.
    Problem-solving method (specify, analyze, design, code, test and debug, refine).
    Chapter #5: Selection. Logical data. logical operators (NOT, AND, OR).
    Logical operators truth table.
    12
    Feb 15
    10
    Pdf
    Video
    73 - 75
    Chapter 5 cont.: Logical operators truth table. Logical expressions evaluation.
    Short circuit method with example.
    Relational operators (<, <=, >, >=). Comparative operators (==, !=).
    Compound statements with Examples illustrating short circuit method side effects.
    WEEK 7
    13
    Feb 20
    11
    Pdf
    Video
    75 - 77
    Lab #6
    HW #4
    Chapter #5 cont.:
  • Revision on Logical operators truth table and Short circuit method.
  • Compound statements revisited with examples.
  • Complements
  • Midterm Exam #1 - Date: Wednesday, February 21 *** Time: 8:00pm - 9:00pm *** Location: ELLT 116
    14
    Feb 22
    12
    Pdf
    Video
    77 - 86
    Chapter #5 cont.:
  • Complements:
    (1) Relational and comparative operators.
    (2) Logical operators.
    examples on Complements.
  • Two way selection:
    (1) if-else with examples. Nested selection (if/if else) . Dangling else.
    (2) Conditional expressions.
  • Multiway selection:
    (1) if / else if / else.
  • WEEK 8
    15
    Feb 27
    13
    Pdf
    Video
    85 - 91
    Lab #7
    Chapter #5 cont.: Multiway selection:
    (1) if / else if / else with examples compared to if if structure.
    (2) switch construct.
  • Fall through behavior.
  • testing floating points for equality challenges.
  • Switch construct rules.
  • When to use a switch and when not to use a switch.
  • if else vs. conditional expressions And if else if vs. switch statements.
  • 16
    Feb 29
    14
    Pdf
    Video
    92 - 96
    Chapter #6: What is Repetition? Repetition vs. Loops
  • Looping basics and terminology.
  • Repetition Flow chart example (calc avg, min and max of exam scores).
  • Pretest and post-test loops.
  • How to choose the right construct.
  • Factorial example.
  • WEEK 9
    17
    Mar 5
    15
    Pdf
    Video
    96 - 102
    Lab #8
    HW #5
    Chapter #6 cont.:
  • Event-controlled vs. Counter-controlled processes.
  • Input validation.
  • Basic syntax of while and do while loops.
  • while vs do-while loops with example(factorial example).
  • Nesting concept. Nested loops with example (range of factorials example).
  • ---
    Mar 7
      NO LECTURE - Lecture is canceled to compensate for evening midterm exam 1
    WEEK 10
    ---
    Mar 12
    SPRING BREAK
    WEEK 11
    18
    Mar 19
    16
    Pdf
    Video
    102 - 112
    Lab #9
    Chapter #6 cont. : Nested loops with example (range of factorials example).
    The infinite loop. The for loop.
    Converting while loops to for loops examples.
    Rearranging digits in a number example.
  • Extract a specific digit from a number.
  • Determine the largest digit in the number( Maximum function).
  • Add the largest digit to correct location.
  • Keep finding the next numbers and when to stop.
  • Counting a certain digit value in a number.
  • 19
    Mar 21
    17
    Pdf
    Video
    116 - 120
    Chapter #8: Arrays:
  • Meaning, motivation and examples from reality.
  • Declaring and defining an array.
  • What is stored in a newly declared array and how to initialize it properly.
  • Accessing array elements. scanf() in an array element.
  • How to loop over all elements in the array.
  • Index range checking.
  • WEEK 12
    20
    Mar 26
    18
    Pdf
    Video
    120 - 126
    Lab #10
    HW #6
    Chapter 8 cont.:
    Index range checking.
    Arrays and Functions:
    1. Pass a single element.
    2. Pass multiple elements individually.
    3. Pass one or more elements by address.
    4. Pass the whole array (can be done only By address).
    5. Objects learned till now (Variables, Array elements, Whole Arrays).
    ---
    Mar 28
      NO LECTURE - Lecture is canceled to compensate for evening midterm exam 2
    WEEK 13
    Midterm Exam #2 - Date: Monday, April 1 *** Time: 8:00pm - 9:30pm *** Location: ELLT 116
    21
    Apr 2
    19
    Pdf
    Video
    126 - 127
    147 - 148
    Lab #11
    Chapter 8 cont.: Arrays and Functions:
  • Pass the whole array revisited.

  • Chapters 9 & 10:
  • Pointers and pointer applications. What is a pointer?
  • How to store an address in a pointer? and how to print the address stored in a pointer?
  • Declaration of a pointer. Pointer initialization (Between functions & within the same function).
  • Example on Pointers and Variables addresses.
  • 22
    Apr 4
    20
    Pdf
    Video
    149 - 151
    Chapters 9 & 10 cont.:
  • Examples on Pointers.
  • Arrays and Pointers with an example.
  • Pointer Arithmetic and Arrays example.
  • WEEK 14
    23
    Apr 9
    21
    Pdf
    Video
    152 - 154
    128 - 130
    Lab #12
    HW #7
    Chapters 9 & 10 cont.:
    1. Values stored in the array.
    2. The addresses of each single element of the array.
    3. Memory Allocation Function - malloc():
      • How to use this relationship to get a dynamic memory allocation during the runtime (malloc).
      • Example on an array defined using malloc function.
    Chapter 8 cont.:
    • Arrays and Measures of Efficiency with examples. Exchanging values appropriately.
    • Sorting terminology (list, pass and swap). The 4 possible ways to sort a list.
      1. Selection Sort: Animated & Solved step by step.
    24
    Apr 11
    22
    Pdf
    Video
    131 - 135
    Chapter 8cont.:
    • Sorting algorithms:
      1. Selection Sort: Revisited
      2. Bubble Sort: Animated & Solved step by step.
        Implementation of Bubble sort (Whole array vs. part of the array).
      3. Insertion Sort: Animated & Solved step by step.
    • Min & Max number of swaps per pass.
    • How many swaps needed to fully sort a list.
    • Summary thoughts of sorting algorithms.
    WEEK 15
    25
    Apr 16
    23
    Pdf
    Video
    136 - 140
    142 - 143
    Lab #13 Quiz
    Chapter 8 cont.: Searching:
    1. Sequential search:
      • Assumptions.
      • How it works.
      • Implementation of the sequential search.
      • Best and worst case scenario.
      • Examples.
    2. Binary search:
      • Assumptions.
      • How it works.
      • Implementation of the Binary search.
      • Examples Binary search examples:
        1. Target is found in the list.
    26
    Apr 18
    24
    Pdf
    Video
    140 - 143
    Chapter 8 cont.: Searching:
    2. Binary search:
  • Assumptions.
  • How it works.
  • Implementation of the Binary search.
  • Best and worst case scenario.
  • Examples Binary search examples:
    1. Target is found in the list.
    2. Target is not found in the list.
  • Exam's shortcut/Hack.
  • WEEK 16
    27
    Apr 23
    25
    Pdf
    Video
    144 - 146
    Open Lab
    (PSO)
    Chapter 8 cont.:
  • Binary Search revisited.
  • Sequential vs. Binary search.
  • Multidimensional Arrays: Declaration and Definition. 1D, 2D, 3D and 4D arrays. 2D arrays example.
  • 28
    Apr 25
    26
    Pdf
    Video
    113 - 115
    Chapter 8 cont.: Recursion
    Final Exam - Date: Monday, April 29 *** Time: 3:30pm - 5:30pm *** Location: ELLT 116

    ❤ I will miss you All ❤

    Powered by DaysPedia.com
    Current Time in West Lafayette
    103255am
    Tue, November 15
    7:33am 09:57 5:30pm