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: Thurs 2:00 - 3:30

  • Fall 2022 - CS15900

    Lecture # Date Lecture Quiz Notes Recording Pages Keywords
    WEEK 1
    1
    Aug 23
    ---
    Pdf
    Video
    1 - 8
    Introduction, course policies and motivations
    2
    Aug 25
    ---
    Pdf
    Video
    65 - 75
    Chapter 1: Introduction to computers, hardware components, CPU components, main memory, processing instructions, programming languages, creating and writing a program, the compiler, hint about: structure and flow charts
    WEEK 2
    3
    Aug 30
    1
    Pdf
    Video
    75 - 81
    Chapter 2: Structure of a C program, Commenting, Identifiers, Data types, Variables.
    4
    Sept 1
    2
    Pdf
    Video
    81 - 87
    Chapter 2 cont.: Literal Constants, Symbolic/Defined Constants, Formatted I/O, Width and precision modifiers, Errors
    WEEK 3
    5
    Sept 6
    3
    Pdf
    Video
    87 - 92
    Chapter #2: Revisiting important concepts: (Width & precision modifiers. printf and scanf. syntax & runtime errors).
    Chapter #3: Expressions(Operators and operands).Operator precedence.Assignment expressions.Simple & Compound assignments. Prefix and postfix (Undefined vs. Well-defined behavior example).
    6
    Sept 8
    4
    Pdf
    Video
    92 - 95
    Chapter #3 cont.: Live Debugging an example. Single and mixed data type expressions. implicit, explicit (type casting), and assignment data type conversions. Rounding, truncation using floor(), type casting to int, truncation in printing using precision modifiers. A brief overview of "Selection via calculation".
    WEEK 4
    7
    Sept 13
    5
    Pdf
    Video
    95 - 97
    Chapter #3 cont.: Selection via calculation. 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.
    8
    Sept 15
    6
    Pdf
    Video
    97 - 101
    Chapter# 4: cont. Top-Down design. Factoring: Each function does a single task (functionally cohesive). Functions terminology. Call / calling / called / Return. Parameter passing. Types of functions. 1- No parameters - no return value: ex. welcome() , menu_options(). 2- No parameters - with return value: ex. get_input().
    WEEK 5
    9
    Sept 20
    7
    Pdf
    Video
    101 - 110
    Chapter#4 cont. Types of functions. 1- No parameters - no return value - welcome() , menu_options() 2- No parameters - with return value - get_input(). 3- With parameters - with return value - Many math.h fx, sin(). 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). Parameter passing: 1- Pass by address.
    10
    Sept 22
    8
    Pdf
    Video
    110 - 114
    Chapter#4 cont. Parameter passing: 1- Pass by address.2- Pass by address. Pointer operations. Scope. Structure Charts. How to read a structure chart. Bad structure charts examples.
    WEEK 6
    11
    Sept 27
    9
    Pdf
    Video
    115 - 118
    Chapter #4 cont. 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. Logical expressions evaluation. Short circuit method with example.
    12
    Sept 29
    10
    Pdf
    Video
    118 - 121
    Chapter#5 cont. : Short circuit examples. Relational operators (<, <=, >, >=). Comparative operators (==, !=). Compound statements. Examples illustrating compound statements with short circuit method. Complements: 1- Relational and comparative operators. 2- Logical operators.
    WEEK 7
    13
    Oct 4
    11
    Pdf
    Video
    121 - 127
    Chapter #5 cont.: Complements with examples. Selection. Flow chart example. Two way selection: if-else with examples. Nested selection. Dangling else.
    Midterm Exam #1 - Date: Wednesday, October 5 *** Time: 6:30pm - 7:30pm *** Location: ELLT 116
    14
    Oct 6
    12
    Pdf
    Video
    127 - 132
    Chapter #5 cont.: Revisiting if-else. Nested selection. Dangling else. Condtional expressions. Multiway selection: (1) if / else if / else with examples compared to if if structure. (2) switch construct.
    WEEK 8
    ---
    Oct 11
      FALL BREAK
    ---
    Oct 13
      NO LECTURE - Lecture is canceled to compensate for evening midterm 1
    WEEK 9
    15
    Oct 18
    13
    Pdf
    Video
    132 - 137
    Chapter #5 cont.: Multiway selection (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 vs. switch statements. Chapter #6: Repetition using loops. looping basics and terminology.
    16
    Oct 20
    14
    Pdf
    Video
    137 - 143
    Chapter #6: Repetition using 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. Event-controlled vs. Counter-controlled processes. Input validation. Basic syntax of while and do while loops. Revisiting Factorial example to demonstrate while and do while loops.
    WEEK 10
    17
    Oct 25
    15
    Pdf
    Video
    143 - 150
    Chapter #6 cont. : while vs do-while loops with example(factorial example). Nesting concept. Nested loops with example (range of factorials example). The infinite loop. The for loop. Converting while loops to for loops examples.
    18
    Oct 27
    16
    Pdf
    Video
    151 - 158
    Chapter #6 cont. : Rearranging digits in a number example. Extract a specific digit from a number. Determine the largest digit in the number( Maximum function). Get the first maximum value vs. the last maximum value. Add the largest digit to correct location. Keep finding the next numbers and when to stop. Counting zeros in a number. Recursion: concepts with examples (Restaurant waiting line & factorial examples). Recursive cases and Base case. Loops vs. Recursion.
    WEEK 11
    19
    Nov 1
    17
    Pdf
    Video
    158 - 161
    Chapter #6 cont.: Recursion example with tracing 4! in memory. When to use Recursion. When to not use Recursion. Review on repetition construct (while, do-while, for loops and recursion) and when to use each of them. Chapter #8: Arrays: Meaning, motivation and examples from reality. Problem of students’ scores stored in memory. Lecture Quiz: 3 questions about for loops, and nested for loops explained in details.
    20
    Nov 3
    18
    Pdf
    Video
    161 - 170
    Chapter #8 cont.: 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. 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).
    WEEK 12
    21
    Nov 8
    19
    Pdf
    Video
    171 - 175
    Chapter 8 cont.: Objects learned till now (Variables, Array elements, Whole Arrays).  Arrays and Measures of Efficiency with examples. Exchanging values appropriately. Sorting terminology (list, pass and swap). Selection Sort: 1- Animated. 2- Solved step by step. 3-The 4 possible ways to sort a list with an exam question as an example.  Bubble sort: Basic idea about how the algorithm works.
    22
    Nov 10
    20
    Pdf
    Video
    175 - 176
    Chapter 8 cont.: Sorting algorithms: (2) Bubble sort and (3) Selection sort with examples. Previous exams' questions.
    WEEK 13
    23
    Nov 15
    21
    Pdf
    Video
    177 - 184
    Chapter 8 cont.: Previous exam sorting algorithm questions. Implementation of Bubble sort (Whole array vs. part of the array). Summary thoughts of sorting algorithms. Searching: (1) Sequential search: Best and worst case scenario. Implementation of a sequential search. (2) Binary search: Best case scenario.
    24
    Nov 17
    22
    Pdf
    Video
    185 - 187
    Chapter 8 cont.: Binary search examples: (1) Target is found in the list. (2) Target is not found. Implementation of Binary search. Highest requested previous exam questions: Spring22: Q26, Q27, Q28, Q29 and Q30.
    Midterm Exam #2 - Date: Thursday, November 17 *** Time: 8:00pm - 9:30pm *** Location: ELLT 116
    WEEK 14
    ---
    Nov 22
      NO LECTURE - Lecture is canceled to compensate for evening midterm 2
    ---
    Nov 24
      THANKSGIVING
    WEEK 15
    25
    Nov 29
    23
    Pdf
    Video
    191 - 195
    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. Arrays and Pointers with an example. Pointer Arithmetic and Arrays example.
    26
    Dec 1
    24
    Pdf
    Video
    195 - 198
    Chapters 9 & 10 cont.: Quick revision on pointers: motivation, applications, and how to declare, initialize and update pointers. Arrays and pointers. Pointer arithmetic and arrays: (1) Values stored in the array and (2) The addresses of each single element of the array. How to use this relationship to get a dynamic memory allocation during the runtime (malloc). An example on an array defined using malloc function.
    WEEK 16
    27
    Dec 6
    25
    Pdf
    Video
    188 -190
    Chapter 8 - Multidimensional Arrays: Declaration and Definition. 1D, 2D, 3D and 4D arrays. 2D arrays example. Previous final exam questions.
    28
    Dec 8
    26
    Pdf
    Video
    Revision and previous exams' questions.
    Final Exam - Date: Friday, Decemeber 16 *** Time: 01:00 - 03:00 PM *** Location: ELLT 116