Skip to content

Commit

Permalink
lect 16
Browse files Browse the repository at this point in the history
  • Loading branch information
dibamirza committed Mar 11, 2024
1 parent f489184 commit 43a321c
Show file tree
Hide file tree
Showing 122 changed files with 1,414 additions and 24 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion _lab/lab04.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: lab
num: lab04
ready: true
desc: "Complexity Analysis - Part 1 (midterm practice lab)"
desc: "Complexity Analysis - Part 1 (midterm practice)"
assigned: 2024-01-31 9:00:00.00-8
due: 2024-02-07 23:59:00.00-8
---
Expand Down
Binary file modified _lectures/CS24_Lecture16.pdf
Binary file not shown.
24 changes: 24 additions & 0 deletions _lectures/lect16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
lecture_date: 2024-03-11
num: "lect16"
desc: "Week 10: Merge Sort"
ready: true
pdfurl: /lectures/CS24_Lecture16.pdf
annotatedpdfurl: /lectures/CS24_Lecture16_ann.pdf
annotatedready: false
---

# Code from lecture
[{{site.lect_repo}}/tree/main/{{page.num}}]({{site.lect_repo}}/tree/main/{{page.num}})

# Topics
* Divide and Conquer Algorithms
- Subdivide a larger problem into smaller problems
- Solve each smaller part
- Combine solutions of smaller sub problems back into the larger problem

* Sorting: So far we covered selection sort which runs in O(n^2)
* Today we will learn about Merge Sort, which runs in O(n log n)
* We'll also continue practicing leetcode problems: <https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/>


17 changes: 17 additions & 0 deletions _pa/pa05.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
num: pa05
ready: true
desc: "Leetcode practice with graph search - bfs and ddfs"
assigned: 2024-03-02 9:00:00.00-8
---
## Additional Practice Problems
1. Lowest Common Ancestor in a Binary Tree (medium): <https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/>
2. Keys and Rooms (medium) <https://leetcode.com/problems/keys-and-rooms/description/>
3. Kth smallest element in a BST (medium) <https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/>
4. Validate BST (medium) <https://leetcode.com/problems/validate-binary-search-tree/>
5. Find if path exists (easy) <https://leetcode.com/problems/find-if-path-exists-in-graph/description/>
6. Rotting Oranges (medium) <https://leetcode.com/problems/rotting-oranges/description/>
7. Minimum Operations to convert number (medium) <https://leetcode.com/problems/minimum-operations-to-convert-number/description/>
8. Max number of fish (medium) <https://leetcode.com/problems/maximum-number-of-fish-in-a-grid/description/>


62 changes: 59 additions & 3 deletions _site/assets/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var dates = [{
"assigned" : "2024-01-31 09:00:00 -0800",
"due" : "2024-02-07 23:59:00 -0800",
"ready" : "true",
"desc" : "Big O practice",
"desc" : "Complexity Analysis - Part 1 (midterm practice)",

}
,{
Expand Down Expand Up @@ -80,6 +80,16 @@ var dates = [{
"ready" : "true",
"desc" : "Application of graphs to machine learning",

}
,{
"type" : "lab",
"url" : "/w24/lab/lab08/",
"num" : "lab08",
"assigned" : "2024-03-07 09:00:00 -0800",
"due" : "2024-03-12 23:59:00 -0800",
"ready" : "true",
"desc" : "Complexity Analysis - Part 2",

}
,{
"type" : "lectures",
Expand Down Expand Up @@ -136,7 +146,7 @@ var dates = [{


"ready" : "true",
"desc" : "Week 3: Efficient search and Binary Search Trees",
"desc" : "Week 3: Efficient search with Binary Search Trees",

"date" : "2024-01-22",

Expand Down Expand Up @@ -268,10 +278,46 @@ var dates = [{


"ready" : "true",
"desc" : "Week 8: Graph serach and Breadth First Traversal",
"desc" : "Week 8: Graph search and Breadth First Traversal",

"date" : "2024-02-28",

}
,{
"type" : "lectures",
"url" : "/w24/lectures/lect14/",
"num" : "lect14",


"ready" : "true",
"desc" : "Week 9: Graph search and Depth First Traversal",

"date" : "2024-03-04",

}
,{
"type" : "lectures",
"url" : "/w24/lectures/lect15/",
"num" : "lect15",


"ready" : "true",
"desc" : "Week 9: Running time analysis of BFS and DFS",

"date" : "2024-03-06",

}
,{
"type" : "lectures",
"url" : "/w24/lectures/lect16/",
"num" : "lect16",


"ready" : "true",
"desc" : "Week 10: Merge Sort",

"date" : "2024-03-11",

}
,{
"type" : "lectures",
Expand Down Expand Up @@ -324,6 +370,16 @@ var dates = [{
"ready" : "true",
"desc" : "Leetcode practice with hashtables and hashmaps",

}
,{
"type" : "pa",
"url" : "/w24/pa/pa05/",
"num" : "pa05",
"assigned" : "2024-03-02 09:00:00 -0800",

"ready" : "true",
"desc" : "Leetcode practice with graph search - bfs and ddfs",

}
,];

Expand Down
30 changes: 30 additions & 0 deletions _site/assets/js/scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ var DEBUGGING_ONLY = {
"num" : "lab07",
},

{
"collection" : "lab",
"url" : "/lab/lab08/",
"num" : "lab08",
},

]
},

Expand Down Expand Up @@ -211,6 +217,24 @@ var DEBUGGING_ONLY = {
"num" : "lect13",
},

{
"collection" : "lectures",
"url" : "/lectures/lect14/",
"num" : "lect14",
},

{
"collection" : "lectures",
"url" : "/lectures/lect15/",
"num" : "lect15",
},

{
"collection" : "lectures",
"url" : "/lectures/lect16/",
"num" : "lect16",
},

{
"collection" : "lectures",
"url" : "/lectures/no-lecture04/",
Expand Down Expand Up @@ -249,6 +273,12 @@ var DEBUGGING_ONLY = {
"num" : "pa04",
},

{
"collection" : "pa",
"url" : "/pa/pa05/",
"num" : "pa05",
},

]
},

Expand Down
69 changes: 64 additions & 5 deletions _site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ <h3 id="lectures">Lectures</h3>
<td class="lect_num">2024-01-22</td>
<td class="lect_num"><a href="/w24/lectures/lect04/" data-ajax="false">lect04</a></td>
<!-- <td class="lect_ready">true</td> -->
<td class="lect_desc">Week 3: Efficient search and Binary Search Trees&nbsp;(<a href="/w24/lectures/CS24_Lecture4.pdf">slides</a>)&nbsp;(<a href="/w24/lectures/CS24_Lecture4_ann.pdf">annotated slides</a>)</td>
<td class="lect_desc">Week 3: Efficient search with Binary Search Trees&nbsp;(<a href="/w24/lectures/CS24_Lecture4.pdf">slides</a>)&nbsp;(<a href="/w24/lectures/CS24_Lecture4_ann.pdf">annotated slides</a>)</td>
</tr>


Expand Down Expand Up @@ -400,7 +400,7 @@ <h3 id="lectures">Lectures</h3>
<td class="lect_num">2024-02-21</td>
<td class="lect_num"><a href="/w24/lectures/lect11/" data-ajax="false">lect11</a></td>
<!-- <td class="lect_ready">true</td> -->
<td class="lect_desc">Week 7: Hashtables, C++ unordered_set and unordered_map ADT&nbsp;(<a href="/w24/lectures/CS24_Lecture11.pdf">slides</a>)</td>
<td class="lect_desc">Week 7: Hashtables, C++ unordered_set and unordered_map ADT&nbsp;(<a href="/w24/lectures/CS24_Lecture11.pdf">slides</a>)&nbsp;(<a href="/w24/lectures/CS24_Lecture11_ann.pdf">annotated slides</a>)</td>
</tr>


Expand All @@ -411,7 +411,7 @@ <h3 id="lectures">Lectures</h3>
<td class="lect_num">2024-02-26</td>
<td class="lect_num"><a href="/w24/lectures/lect12/" data-ajax="false">lect12</a></td>
<!-- <td class="lect_ready">true</td> -->
<td class="lect_desc">Week 8: Graph representation with applications to Neural Networks&nbsp;(<a href="/w24/lectures/CS24_Lecture12.pdf">slides</a>)</td>
<td class="lect_desc">Week 8: Graph representation with applications to Neural Networks&nbsp;(<a href="/w24/lectures/CS24_Lecture12.pdf">slides</a>)&nbsp;(<a href="/w24/lectures/CS24_Lecture12_ann.pdf">annotated slides</a>)</td>
</tr>


Expand All @@ -422,7 +422,40 @@ <h3 id="lectures">Lectures</h3>
<td class="lect_num">2024-02-28</td>
<td class="lect_num"><a href="/w24/lectures/lect13/" data-ajax="false">lect13</a></td>
<!-- <td class="lect_ready">true</td> -->
<td class="lect_desc">Week 8: Graph serach and Breadth First Traversal&nbsp;(<a href="/w24/lectures/CS24_Lecture13.pdf">slides</a>)</td>
<td class="lect_desc">Week 8: Graph search and Breadth First Traversal&nbsp;(<a href="/w24/lectures/CS24_Lecture13.pdf">slides</a>)&nbsp;(<a href="/w24/lectures/CS24_Lecture13_ann.pdf">annotated slides</a>)</td>
</tr>





<tr class="ready">
<td class="lect_num">2024-03-04</td>
<td class="lect_num"><a href="/w24/lectures/lect14/" data-ajax="false">lect14</a></td>
<!-- <td class="lect_ready">true</td> -->
<td class="lect_desc">Week 9: Graph search and Depth First Traversal&nbsp;(<a href="/w24/lectures/CS24_Lecture14.pdf">slides</a>)&nbsp;(<a href="/w24/lectures/CS24_Lecture14_ann.pdf">annotated slides</a>)</td>
</tr>





<tr class="ready">
<td class="lect_num">2024-03-06</td>
<td class="lect_num"><a href="/w24/lectures/lect15/" data-ajax="false">lect15</a></td>
<!-- <td class="lect_ready">true</td> -->
<td class="lect_desc">Week 9: Running time analysis of BFS and DFS&nbsp;(<a href="/w24/lectures/CS24_Lecture15.pdf">slides</a>)&nbsp;(<a href="/w24/lectures/CS24_Lecture15_ann.pdf">annotated slides</a>)</td>
</tr>





<tr class="ready">
<td class="lect_num">2024-03-11</td>
<td class="lect_num"><a href="/w24/lectures/lect16/" data-ajax="false">lect16</a></td>
<!-- <td class="lect_ready">true</td> -->
<td class="lect_desc">Week 10: Merge Sort&nbsp;(<a href="/w24/lectures/CS24_Lecture16.pdf">slides</a>)</td>
</tr>


Expand Down Expand Up @@ -518,7 +551,7 @@ <h3 id="programming-assignments">Programming Assignments</h3>
<tr class="ready">
<td class="asn_num"><a href="/w24/lab/lab04/" data-ajax="false">lab04</a></td>
<td class="asn_ready">true</td>
<td class="asn_desc">Big O practice</td>
<td class="asn_desc">Complexity Analysis - Part 1 (midterm practice)</td>
<td class="asn_date">Wed 01/31 09:00AM</td>
<td class="asn_date">Wed 02/07 11:59PM</td>
</tr>
Expand Down Expand Up @@ -579,6 +612,19 @@ <h3 id="programming-assignments">Programming Assignments</h3>




<tr class="ready">
<td class="asn_num"><a href="/w24/lab/lab08/" data-ajax="false">lab08</a></td>
<td class="asn_ready">true</td>
<td class="asn_desc">Complexity Analysis - Part 2</td>
<td class="asn_date">Thu 03/07 09:00AM</td>
<td class="asn_date">Tue 03/12 11:59PM</td>
</tr>





</table>

</div>
Expand Down Expand Up @@ -650,6 +696,19 @@ <h3 id="leetcode-practice-problems">Leetcode Practice Problems</h3>




<tr class="ready">
<td class="asn_num"><a href="/w24/pa/pa05/" data-ajax="false">pa05</a></td>
<td class="asn_ready">true</td>
<td class="asn_desc">Leetcode practice with graph search - bfs and ddfs</td>
<td class="asn_date">Sat 03/02 09:00AM</td>
<td class="asn_date"></td>
</tr>





</table>

</div>
Expand Down
8 changes: 4 additions & 4 deletions _site/lab/lab04/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@



<title>lab04 - Big O practice - </title>
<title>lab04 - Complexity Analysis - Part 1 (midterm practice) - </title>
</head>
<body id="page-top">
<div class="container">
Expand Down Expand Up @@ -171,7 +171,7 @@


<div id="content" class="ui-content">
<h1>lab04 : Big O practice</h1>
<h1>lab04 : Complexity Analysis - Part 1 (midterm practice)</h1>
<table class="asn_table">
<!-- asn_table_header_row.html -->
<tr>
Expand All @@ -187,7 +187,7 @@ <h1>lab04 : Big O practice</h1>
<tr class="ready" >
<td class="asn_num" ><a href="/w24/lab/lab04/" data-ajax="false">lab04</a></td>
<td class="asn_ready">true</td>
<td class="asn_desc" >Big O practice</td>
<td class="asn_desc" >Complexity Analysis - Part 1 (midterm practice)</td>
<td class="asn_date" >Wed 01/31 09:00AM</td>
<td class="asn_date" >Wed 02/07 11:59PM</td>
</tr>
Expand All @@ -196,7 +196,7 @@ <h1>lab04 : Big O practice</h1>

</table>
<h2 id="collaboration-policy">Collaboration policy</h2>
<p>This lab must be done individually</p>
<p>This lab must be done individually. Note that this lab is only for practice and will not count toward your final grade</p>

<h2 id="description">Description</h2>
<p>Please navigate to lab04 on gradescope and work to complete the Big-O practice problems provided.</p>
Expand Down
Loading

0 comments on commit 43a321c

Please sign in to comment.