Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

first commit #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Searching-Sorting Workshop/searching/1.md
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.
Copy link
Contributor

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

36 changes: 36 additions & 0 deletions Searching-Sorting Workshop/searching/10.md
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.
14 changes: 14 additions & 0 deletions Searching-Sorting Workshop/searching/2.md
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!
19 changes: 19 additions & 0 deletions Searching-Sorting Workshop/searching/3.md
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").
15 changes: 15 additions & 0 deletions Searching-Sorting Workshop/searching/4.md
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
17 changes: 17 additions & 0 deletions Searching-Sorting Workshop/searching/5.md
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** :
27 changes: 27 additions & 0 deletions Searching-Sorting Workshop/searching/6.md
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.
14 changes: 14 additions & 0 deletions Searching-Sorting Workshop/searching/7.md
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
30 changes: 30 additions & 0 deletions Searching-Sorting Workshop/searching/8.md
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.
13 changes: 13 additions & 0 deletions Searching-Sorting Workshop/searching/9.md
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.
12 changes: 12 additions & 0 deletions Searching-Sorting Workshop/sorting/1.md
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.
17 changes: 17 additions & 0 deletions Searching-Sorting Workshop/sorting/10.md
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.
13 changes: 13 additions & 0 deletions Searching-Sorting Workshop/sorting/11.md
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:
12 changes: 12 additions & 0 deletions Searching-Sorting Workshop/sorting/12.md
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:
17 changes: 17 additions & 0 deletions Searching-Sorting Workshop/sorting/13.md
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:


27 changes: 27 additions & 0 deletions Searching-Sorting Workshop/sorting/14.md
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

27 changes: 27 additions & 0 deletions Searching-Sorting Workshop/sorting/15.md
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

17 changes: 17 additions & 0 deletions Searching-Sorting Workshop/sorting/16.md
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.

14 changes: 14 additions & 0 deletions Searching-Sorting Workshop/sorting/17.md
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:

11 changes: 11 additions & 0 deletions Searching-Sorting Workshop/sorting/18.md
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:
Loading