Lecture 
Section 001 
Section 002 
Topics, Comments 
1 Tu 1/16 
cancelled

video

 Lecture online only. Use Teams > Calendar to join the lecture.
 Per UTA MavAlert, classes before 11am are cancelled. Classes after 11 am are held. Therefore:
 lecture for section 001 is cancelled  Please watch the recording for 002 for this lecture.
 lecture for section 002 is held online. If you are in section 001, feel free to attend the 002 lecture. Click here to join the 002 meeting
 If you have trouble join the meeting or during it, contact:
Carl: axm0693(at)mavs.uta.edu for section 002 (11am12:20pm)
 Introductions
 Syllabus
 Prof. French's guide on how to set up Visual Studio Code to run C programs  link sent by Jack during meeting. This link was added on teh Code page as well under IDEs.
 C review, coding resources, IDE (Code::Blocks and onlinegdb.com), omega  see Code page under "Coding resources".
 Course navigation: OneNote (student section, student view in Teams), Daily page (videos, notes), Code
 Updated after lecture:
 the Schedule at the end of the Syllabus
 2 bonus points per unused extension day (see Syllabus)
 anonymous questions allowed in Q&A
 link to video
 NOT done:
 Slides: Course overview
 More coding resources
 Slides: Aryan's C review
 COMMON ERRORS IN C  WATCH THIS VIDEO (30 minutes). It shows and explains common and tricky C errors related to pointers, arrays, and strings (starting from error number 7 or so). Use double speed, if you prefer, but DO watch it!
 leetcode some fun problems (just presented, not solved)
 Guess a number between 1 and 100 inclusive, using less/greater questions.

2 Th 1/18 
notes,
video

notes,
video


3 Tu 1/23 
notes,
video

notes,
video

 loop invariant and proof of correction of insertion sort
 indirect sorting
 binary search and number of loop repetitions as a function of array size N.
 Not for binary search: integer division : (left + right)/2 = (3+10)/2 = 6




********* Recitation  Math , VSCode by Aryan and Jack
Math slides by Aryan were sent in the announcement after the meeting and here: (pdf) and (pptx).
VSCode slides by Jack: Canvas>Modules> System Requirements > "How to use SSH with VSCode" and
( here)

4 Th 1/25 
notes,
video

notes,
video

Time Complexity
 Time complexity of loops 2024 slides
 motivation
 O notation
 O for expressions with 2 variables
 table method
 Before next class, think about the coding problem I gave at beginning of class. Think what time complexity your solution has (in terms of sizes N and M of the 2 arrays). And also give your answer for and the TC problem left at the end of class: O(1) + O(2) +O(4) + O(8) +.... + O(N) = O(???).

5 Tu 1/30 
notes,
video

notes,
video

 TC function calls, TC of loops with function calls,
 sum of geometric series 1 to n
 TC of sequential loops
 difference: in 001  shown example with log in TC. In 002 used example from the slides for sequential loops, where we use N = rightleft+1.

6 Th 2/1 
notes,
video

notes,
video

 TC big example
 TC If instructions
 TC and SC (space complexity) insertion sort  001, 002
 TC, SC binary search only for 001, not 002.
 next lecture: give code that has exponential TC




********* Recitation  C review by Aryan. Below is a list with the minute and the topic covered
 0 C review (basic types, structs, pointers, recursion)
 20  1D dynamic array allocation (malloc(), access, free() )
 26  2D dynamic array allocation (malloc(), access, free() )
 29  Shell commands
 29:50  input and output program redirection
 35  2D array formatted printing
 41  compile a program that consists of multiple files (see expected_output.c, printlib.c and printlib.h)
 44  using diff to compare two files
 47  debugging with gdb, includes recording the debugging session and reversing a step

7 Tu 2/6 
notes,
video

notes,
video

O, Ω, Θ, o, ω
 give code that has a specific TC (e.g. 1+2+4+8+...+2^N)
 002  TC, SC binary search
 graphing calculator
 Definition, examples and properties
 O, Ω, Θ, o, ω summary sheet
 002  to do TC and SC for binary search.
 001 vs 002
 In 001 I showed more examples with the slider in the graphing calculator. Students from 002 that want to see more examples should use a slider for a lgN function like we did for 5N+20. Also use a slider to see if N+lgN is Θ(N).
 In 001 we gave more examples of functions in the each set and we talked a bit more about the image with the set intersection for O(N^2), Ω(N^2)
 in 002  we discussed that the pow(2,j) function is not O(1). We gave code that produces the value 2^j, without calling the function.

8 Th 2/8 
notes,
video

notes,
video


9 Tu 2/13 
notes, linked list
video

notes,
video


10 Th 2/15 
notes,
video

notes,
video

 The instructor is sick and will teach from home, through Teams.
 finish bucket sort
 leetcode  make an account. It will be needed for hw2 and I recomend it for coding interview practice. If you do not want to make an account, contact the instructor to discuss alternatives.
 Binary Trees (theory only)  we covered pages 25, page 12 covers full tree, the property that we used to help derive the TC for tree traversal functions.
 Binary Trees (data structure, code)

11 Tu 2/20 
notes,
video

notes,
video

 bucket sort  finished
 level order traversal of binary trees  code, TC, SC. From Binary Trees (data structure, code)
 binary trees theory  complete tree (height, number of nodes on last level) full tree (external nodes = 1+internal nodes)
 Search tree: Binary Search Tree
 BST (binary search tree)  everything except "is this a valid search in a BST?", the main slide for identifying the current range of valid values in this place in the tree, briefly talked about left and right rotation.

12 Th 2/22 
notes,
video

notes,
video

 range of values in a subtree based on search path from root
 valid search path in a BST
 left and right rotations used in insert function to insert at root
 108. Convert Sorted Array to Binary Search Tree  3 solutions and their TC
 Stack: with linked list and with array





********* Review session by Carl and Jack

13 Tu 2/27 
notes,
video

notes,
video


 Self study of 234 trees from this video. Ask in class any questions.
 Fun problems:
 (Binary) Heap
 remove covered in 002 , not covered in 001.

14 Th 2/27 


 Exam 1  in class, during lecture time

15 Tu 3/5 
notes,
video

notes,
video

 Finish Heap slides:
 002  remove
 build by repeated insertion  TC
 build bottom up,
 heap sort
 minheap
 find topk items
 FIFO queue

16 Th 3/7 
notes,
video

notes,
video

Hash table

17 Tu 3/19 
notes,
video

notes,
video

 Two sum  O(N) solution?
 Hash table:
 finish double hashing, quadratic hashing  compute first 3 indices
 cells with deleted data and searching (mark deleted different from originally empty)
 Greedy  0/1 Knapsack, Greedy
001  not finished Job Scheduling
002  finished all

18 Th 3/21 
notes,
video

notes,
video

 001  finish Job Scheduling  Greedy
 Dynamic Programming (DP)  Knapsack, Job Scheduling, (pdf, pptx )
 Job Scheduling
 DP solution,
 brute force TC,
 recursive solution (and TC just mentioned),
 memoized  code, TC (tree of recursive calls shown in both sections.
full tree and 2N1 nodes  done in sectin 002, but not in 001
 DP leetcode problem lists:

19 Tu 3/26 
notes,
video

notes,
video

 Knapsack, Job Scheduling, (pdf, pptx ) slides
 0/1 Knapsack  Dynamic Programming  iterative, TC ("pseudopolynomial in W"), SC, space improvement (W),
 Fibonacci  recursive (exponential TC, no proof given), iterative (linear TC, linear SC)
 002  left question: can you improve space used for iterative Fibonacci solution?

20 Th 3/28 
notes,
video

notes,
video


Fri 3/29 


Aryan's Exam 2 review session, Friday 3/29
3318_heaps1.pptx
3318_rdp1.pptx

21 Tu 4/2 


Midterm Exam 2  in classroom, during leture time

22 Th 4/4 
notes,
video

notes,
video

Slides Edit Distance, Longest Common Subsequence, Longest Increasing Subsequence ( pptx)
Counting problems
LIS (Longest Increasing Subsequence),
ED (Edit Distance)

23 Tu 4/9 
notes,
video

notes,
main video
short video,

lecture online only  bad weather
Graphs
001  described BFS from page with BFS and DFS sidebyside and the application of BFS. Did work through the pseudocode.
002  did not do anything for BFS.

25 Th 4/11 
notes,
video

notes, Adj List
video

Graphs
DAGs and Topological sorting
Strongly connected components in directed graphs

26 Tu 4/16 
notes,
Worksheet:
pdf,(docx)
video

notes,
Worksheet: ,
pdf,(docx)
video

Graphs
BFS (Breadth First Search)
Worksheet pdf,(docx)
Prim's Algorithm for MST (Minimum Spanning Tree)
not done Prim's TC, SC
001  correction in discussed TC: O(E) instead of O(V+E)

27 Th 4/18 
notes,
video

notes,
video

Prim  finish TC, SC
Shortest Paths single pair shortest path and all pairs shortest path.
Worksheet pdf,(docx)
Merge sort : code, animation (DS Visualizations).
(Not done: TC, SC, array after each call to merge, insertion sort for base case)
002  done bitonic sequence (but not for 001)

28 Th 4/23 
notes,
video

notes,
video

Merge sort  finish
002  not discussed bottom up merge sort and ?insertion sort for base case? (covered in 001)

29 Th 4/25 
notes from 002,
video

notes,
video

Recurrences
 code <=> recurrences
 tree method
 Master Theorem
 Covered in 002, but not in 001:
 the upper and lower bounding of a recurrence (in tree form or with 2 other recurrences)
 Case 3 of M1 and M2

30 Th 4/30 
notes,
video

notes,
video

Recurrences  Master Theorem, finished (common recurrences, inadmissible equations, and for 001: M2 and M1case 3)
Quick sort  animation from Visual Algo (alg, code, TC, SC, best,worst, improvements, quickselect)
