This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
first commit #15
Open
MarcoBrian
wants to merge
1
commit into
master
Choose a base branch
from
Marco
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
first commit #15
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
** Type: ** Title slide | ||
|
||
** Title: ** Searching | ||
|
||
|
||
** Content** : | ||
|
||
*No content here just title for introduction* | ||
|
||
** Speaker's notes** : | ||
|
||
Briefly go about telling what this presentation will be about. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
** Type: ** Code steps | ||
|
||
** Title: ** Binary search implementation | ||
|
||
|
||
** Content** : | ||
```Python | ||
def binarySearch (arr, l, r, x): | ||
|
||
# Check base case | ||
if r >= l: | ||
|
||
mid = l + (r - l)/2 | ||
|
||
# If element is present at the middle itself | ||
if arr[mid] == x: | ||
return mid | ||
|
||
# If element is smaller than mid, then it | ||
# can only be present in left subarray | ||
elif arr[mid] > x: | ||
return binarySearch(arr, l, mid-1, x) | ||
|
||
# Else the element can only be present | ||
# in right subarray | ||
else: | ||
return binarySearch(arr, mid + 1, r, x) | ||
|
||
else: | ||
# Element is not present in the array | ||
return -1 | ||
``` | ||
|
||
|
||
** Speaker's notes** : | ||
Show the code in full and then break down the explanation part by part. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
** Type: ** Headline | ||
|
||
** Title: ** Motivation to searching | ||
|
||
** Content** : Motivation to why we need searching | ||
|
||
add visual to help prove a point | ||
|
||
** Speaker's notes** : | ||
|
||
|
||
Suppose, for example, I love watching movies. I have collections of all of the *Harry Potter*, *The Lord of the Rings*, and *James Bond* films. I have invited some friends to binge-watch them with me tomorrow morning, but I woke up late and need to find the movies quickly! How can I find the movies that I want to watch in the most efficient manner possible, before the doorbell rings? | ||
|
||
Now extend this problem to wide-scale computer systems. What if we needed to find certain information (say, for example, medical records) from stored data in a timely fashion? What sort of algorithms should we implement? Luckily, Computer Scientists have developed answers for us! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
** Type: ** Text + Img | ||
|
||
** Title: ** Graphs | ||
|
||
|
||
** Content** : | ||
|
||
A graph in computer science is a visual representation of a set of nodes that are connected together by edges, and graphs allow us to view information and relationships in data structures. | ||
|
||
Add image of a graph | ||
|
||
|
||
|
||
** Speaker's notes** : | ||
|
||
|
||
What can we do with graphs? Graph traversal, or graph search, is the process of visiting each vertex in a graph. This is important because, as we traverse through a graph, we can change or update each vertex that is visited, which can be very useful! | ||
|
||
How can we store graphs? Graphs can be stored in lists and matrices, and for instance, the two most commonly-used methods to store a graph are in an adjacency list and an adjacency matrix. An adjacency list is an array that notes each node with the vertices that are directly connected, or adjacent, to it by an edge, and an adjacency matrix is a matrix that notes which nodes are adjacent to each other with a "1" (if the nodes are not adjacent, then this is noted by a "0"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
** Type: ** comparison left and right | ||
|
||
** Title: ** BFS & DFS | ||
|
||
|
||
** Content** : | ||
Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key'), and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level. | ||
|
||
|
||
DFS - The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking. | ||
|
||
|
||
** Speaker's notes** : | ||
|
||
Highlight the two searching algorithm that you are going to discuss and their differences |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
** Type: ** left image + text | ||
|
||
** Title: ** DFS | ||
|
||
|
||
** Content** : | ||
|
||
The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking. | ||
|
||
|
||
- **Rule 1** − Visit the adjacent unvisited vertex. Mark it as visited. Display it. Push it in a stack. | ||
- **Rule 2** − If no adjacent vertex is found, pop up a vertex from the stack. (It will pop up all the vertices from the stack, which do not have adjacent vertices.) | ||
- **Rule 3** − Repeat Rule 1 and Rule 2 until the stack is empty. | ||
|
||
Add visual for help | ||
|
||
** Speaker's notes** : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
** Type: ** Code steps | ||
|
||
** Title: ** DFS implementation | ||
|
||
|
||
** Content** : | ||
|
||
```python | ||
def DFSUtil(self, v, visited): | ||
|
||
#first breakdown | ||
visited[v] = True | ||
print(v, end = ' ') | ||
|
||
#second breakdown | ||
for i in self.graph[v]: | ||
if visited[i] == False: | ||
self.DFSUtil(i, visited) | ||
|
||
#third breakdown | ||
def DFS(self, v): | ||
visited = [False] * (len(self.graph)) | ||
self.DFSUtil(v, visited) | ||
``` | ||
|
||
** Speaker's notes** : | ||
Show the code in full and then break down the explanation part by part. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
** Type: ** left image + text | ||
|
||
** Title: ** BFS | ||
|
||
- **Rule 1** − Visit the adjacent unvisited vertex. Mark it as visited. Display it. Insert it in a queue. | ||
- **Rule 2** − If no adjacent vertex is found, remove the first vertex from the queue. | ||
- **Rule 3** − Repeat Rule 1 and Rule 2 until the queue is empty. | ||
|
||
Add visuals for explanation | ||
|
||
** Content** : | ||
|
||
** Speaker's notes** : | ||
Give indepth explanation of BFS without code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
** Type: ** Code steps | ||
|
||
** Title: ** BFS implementation | ||
|
||
|
||
** Content** : | ||
|
||
```python | ||
def BFS(self, s): | ||
#1st breakdown | ||
visited = [False] * (len(self.graph)) | ||
#2nd breakdown | ||
queue = [] | ||
#3rd breakdown | ||
queue.append(s) | ||
visited[s] = True | ||
#4th breakdown | ||
while queue: | ||
s = queue.pop(0) | ||
print (s, end = " ") | ||
#5th breakdown | ||
for i in self.graph[s]: | ||
if visited[i] == False: | ||
queue.append(i) | ||
visited[i] = True | ||
``` | ||
|
||
|
||
** Speaker's notes** : | ||
Show the code in full and then break down the explanation part by part. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
** Type: ** left image + text | ||
|
||
** Title: ** Binary search | ||
|
||
|
||
** Content** : | ||
|
||
*Best explained with visuals* | ||
Just use visuals here and let the presenter explain binary search, many wordings in the slidies may cause confusion. | ||
|
||
** Speaker's notes** : | ||
|
||
Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
** Type: ** Title slide | ||
|
||
** Title: ** Sorting | ||
|
||
|
||
** Content** : | ||
|
||
*No content here just title for introduction* | ||
|
||
** Speaker's notes** : | ||
|
||
Briefly go about telling what this presentation will be about. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
** Type: ** Center img outline | ||
|
||
|
||
** Title: ** Insertion sort | ||
|
||
|
||
** Content** : | ||
Add this GIF | ||
![](https://upload.wikimedia.org/wikipedia/commons/0/0f/Insertion-sort-example-300px.gif) | ||
for visualisation | ||
|
||
|
||
|
||
** Speaker's notes** : | ||
|
||
|
||
Insertion sort uproots the current element of a list, compares it to all previous elements that we have already looked it, and places it in the appropriate spot. Because of this, insertion sort only needs one pass to fully sort a list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
** Type: ** Center img outline | ||
|
||
** Title: ** Insertion sort step by step 1 | ||
|
||
|
||
** Content** : | ||
|
||
<img src="https://i.imgur.com/txZo0zv.png" style="zoom:50%;" /> | ||
|
||
|
||
** Speaker's notes** : | ||
|
||
1. We first take the second element and compare it to the first. If it is smaller, we place it before the first element. We are trying to sort the array from smallest to largest. After this initial step, our sample list will look like this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
** Type: ** Center img outline | ||
|
||
** Title: ** Insertion sort step by step 2 | ||
|
||
|
||
** Content** : | ||
|
||
<img src="https://i.imgur.com/xkGGZnO.png" style="zoom:50%;" /> | ||
|
||
** Speaker's notes** : | ||
|
||
2. Move onto the next element, in this case 3. Since this is the third element, we compare it to the previous *two* elements. 3 is smaller than both 5 and 6, so it will be placed in the first position of our list. Our list now looks like this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
** Type: ** Center img outline | ||
|
||
** Title: ** Insertion sort step by step 1 | ||
|
||
|
||
** Content** : | ||
|
||
<img src="https://i.imgur.com/3NTptL2.png" style="zoom:50%;" /> | ||
|
||
|
||
** Speaker's notes** : | ||
|
||
|
||
|
||
3. We continue down the list and keep repeating this process, comparing the nth element with the n - 1 previous elements, and adjusting its position until we get a fully sorted array as shown below: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
** Type: ** Code steps | ||
|
||
** Title: ** Insertion | ||
sort implementation | ||
|
||
** Content** : | ||
|
||
|
||
```python | ||
def insertionSort(arr): | ||
for i in range(1, len(arr)): | ||
key = arr[i] | ||
j = i-1 | ||
while j >= 0 and key < arr[j]: | ||
arr[j+1] = arr[j] | ||
j -= 1 | ||
arr[j + 1] = key | ||
``` | ||
|
||
|
||
|
||
|
||
** Speaker notes ** : | ||
|
||
Break down into steps | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
** Type: ** Code steps | ||
|
||
** Title: ** Insertion | ||
sort implementation | ||
|
||
** Content** : | ||
|
||
|
||
```python | ||
def insertionSort(arr): | ||
for i in range(1, len(arr)): | ||
key = arr[i] | ||
j = i-1 | ||
while j >= 0 and key < arr[j]: | ||
arr[j+1] = arr[j] | ||
j -= 1 | ||
arr[j + 1] = key | ||
``` | ||
|
||
|
||
|
||
|
||
** Speaker notes ** : | ||
|
||
Break down into steps | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
** Type: ** Center img outline | ||
|
||
|
||
** Title: ** Merge sort | ||
|
||
|
||
** Content** : | ||
|
||
for visualisation | ||
![](https://miro.medium.com/max/1034/1*nqwPr-tms9xXy6aCgIZarg.gif) | ||
|
||
|
||
|
||
** Speaker's notes** : | ||
|
||
If we pretend we have to sort a deck of cards, Mergesort can be thought of as dividing up the work by cutting the deck into smaller, more manageable groups and rearranging the cards before bringing it all back together. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
** Type: ** Center img outline | ||
|
||
** Title: ** Merge sort step by step 1 | ||
|
||
|
||
** Content** : | ||
|
||
<img src="https://i.imgur.com/zhCRdhv.png" style="zoom:50%;" /> | ||
|
||
<img src="https://i.imgur.com/E2KzWhA.png" style="zoom:50%;" /> | ||
|
||
** Speaker's notes** : | ||
1. First, divide the list in half, or something close to it. It's alright if one half is bigger. This is just because there was an odd number of elements in our list. After this first division, our sample list now looks like this: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
** Type: ** Center img outline | ||
|
||
** Title: ** Merge sort step by step 2 | ||
|
||
|
||
** Content** : | ||
|
||
<img src="https://i.imgur.com/6OGmFkG.png" style="zoom:50%;" /> | ||
|
||
** Speaker's notes** : | ||
2. Keep dividing up each list in half until every original element is by itself: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a bit more specific