Skip to content

Commit fda350e

Browse files
author
Flor Silvestre
committed
Fix images paths
1 parent f746fe3 commit fda350e

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

algorithms/popular-algorithms.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A simple approach is to do linear search.The time complexity of above algorithm
1111

1212
The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(Log n).
1313

14-
![Binary-Search](assets/binary-search.jpg)
14+
![Binary-Search](./assets/binary-search.jpg)
1515

1616
We basically ignore half of the elements just after one comparison.
1717

@@ -56,7 +56,7 @@ The above recurrence can be solved either using Recurrence Tree method or Master
5656

5757
### Interpolation Search
5858

59-
![Interpolation Search](assets/interpolation-search.png)
59+
![Interpolation Search](./assets/interpolation-search.png)
6060

6161
Improved variant of binary search. This search algorithm works on the probing position of the required value. For this algorithm to work properly, the data collection should be in a sorted form and equally distributed.
6262

@@ -126,102 +126,102 @@ End Procedure
126126
```
127127

128128
## [Sorting](sorting_algorithms.py)
129-
![Sorting](assets/sorting-algorithm-comparison.jpg)
129+
![Sorting](./assets/sorting-algorithm-comparison.jpg)
130130

131131
### Bubble Sort
132132

133133
It is a comparison-based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in order.
134134

135-
![Bubble sort](assets/bubble-short.png)
135+
![Bubble sort](./assets/bubble-short.png)
136136

137137
### Merge Sort
138138

139139
Merge sort first divides the array into equal halves and then combines them in a sorted manner.
140140

141-
![Merge sort](assets/merge-sort-algorithm-codesjavapng.png)
141+
![Merge sort](./assets/merge-sort-algorithm-codesjavapng.png)
142142

143143
### Insertion Sort
144144

145145
Insertion sort involves finding the right place for a given element in a sorted list. So in beginning we compare the first two elements and sort them by comparing them. Then we pick the third element and find its proper position among the previous two sorted elements. This way we gradually go on adding more elements to the already sorted list by putting them in their proper position.
146146

147-
![Insertion sort](assets/insertion-sort.png)
147+
![Insertion sort](./assets/insertion-sort.png)
148148

149149
### Shell Sort
150150

151151
Shell Sort involves sorting elements which are away from ech other. We sort a large sublist of a given list and go on reducing the size of the list until all elements are sorted. The below program finds the gap by equating it to half of the length of the list size and then starts sorting all elements in it. Then we keep resetting the gap until the entire list is sorted.
152152

153-
![Shell sort](assets/shell-sort.jpg)
153+
![Shell sort](./assets/shell-sort.jpg)
154154

155155
### Select Sort
156156

157157
In selection sort we start by finding the minimum value in a given list and move it to a sorted list. Then we repeat the process for each of the remaining elements in the unsorted list. The next element entering the sorted list is compared with the existing elements and placed at its correct position. So at the end all the elements from the unsorted list are sorted.
158158

159-
![Select sort](assets/selection-short.png)
159+
![Select sort](./assets/selection-short.png)
160160

161161
## [Graphs](graphs_traversals.py)
162162

163-
![Graphs](assets/graph-traversals.jpeg)
163+
![Graphs](./assets/graph-traversals.jpeg)
164164

165165
### Depth First Traversal
166166

167167
Also called depth first search (DFS),this algorithm traverses a graph in a depth ward motion and uses a stack to remember to get the next vertex to start a search, when a dead end occurs in any iteration. We implement DFS for a graph in python using the set data types as they provide the required functionalities to keep track of visited and unvisited nodes.
168168

169-
![Depth First Traversal](assets/dfs.jpeg)
169+
![Depth First Traversal](./assets/dfs.jpeg)
170170

171171
### Breadth First Traversal
172172

173173
Also called breadth first search (BFS),this algorithm traverses a graph breadth ward motion and uses a queue to remember to get the next vertex to start a search, when a dead end occurs in any iteration. Please visit this link in our website to understand the details of BFS steps for a graph.
174174

175175
We implement BFS for a graph in python using queue data structure discussed earlier. When we keep visiting the adjacent unvisited nodes and keep adding it to the queue. Then we start dequeue only the node which is left with no unvisited nodes. We stop the program when there is no next adjacent node to be visited.
176176

177-
![Breadth First Traversal](assets/bfs.jpeg)
177+
![Breadth First Traversal](./assets/bfs.jpeg)
178178

179179
## Recursion
180-
![iterative-vs-recursion](assets/iterative-vs-recursion.png)
180+
![iterative-vs-recursion](./assets/iterative-vs-recursion.png)
181181

182182
## Greedy
183-
![activity-selection-problem1-l.jpg](assets/algorithms.jpeg)
183+
![activity-selection-problem1-l.jpg](./assets/algorithms.jpeg)
184184

185185
### Activity Selection Problem
186186

187-
![activity-selection-problem1-l.jpg](assets/activity-selection-problem1-l.jpg)
187+
![activity-selection-problem1-l.jpg](./assets/activity-selection-problem1-l.jpg)
188188

189-
![activity-selection.png](assets/activity-selection.png)
189+
![activity-selection.png](./assets/activity-selection.png)
190190

191191
### Kruskal Minimum Spanning Tree
192192

193-
![kruskal-min-spanning-tree.png](assets/kruskal-min-spanning-tree.png)
193+
![kruskal-min-spanning-tree.png](./assets/kruskal-min-spanning-tree.png)
194194

195195

196196
### Huffman Coding
197197

198-
![huffman7.png](assets/huffman7.png)
198+
![huffman7.png](./assets/huffman7.png)
199199

200200

201201
### Job Sequencing
202202

203-
![job-sequencing.png](assets/JobSequencing.jpg)
203+
![job-sequencing.png](./assets/JobSequencing.jpg)
204204

205205

206206
### Dijksta Minimum Path
207207

208-
![dijkstra-min-path.jpg](assets/dijkstra-min-path.jpg)
208+
![dijkstra-min-path.jpg](./assets/dijkstra-min-path.jpg)
209209

210210

211211
### Prim Minimum Spanning Tree
212212

213-
![prim-mst.jpg](assets/prim-mst.jpg)
213+
![prim-mst.jpg](./assets/prim-mst.jpg)
214214

215215

216216
## Dynamic Programming
217-
![activity-selection-problem1-l.jpg](assets/dynamic-programming.jpeg)
217+
![activity-selection-problem1-l.jpg](./assets/dynamic-programming.jpeg)
218218

219219
### Knapsack problem
220220

221-
![activity-selection-problem1-l.jpg](assets/knapsack-problem-using-Dynamic-Programming-min.png)
221+
![activity-selection-problem1-l.jpg](./assets/knapsack-problem-using-Dynamic-Programming-min.png)
222222

223-
![activity-selection-problem1-l.jpg](assets/knapsack-problem-using-Dynamic-Programming-min-min.png)
223+
![activity-selection-problem1-l.jpg](./assets/knapsack-problem-using-Dynamic-Programming-min-min.png)
224224

225225
## Backtracking
226226

227-
![activity-selection-problem1-l.jpg](assets/backtracking.png)
227+
![activity-selection-problem1-l.jpg](./assets/backtracking.png)

0 commit comments

Comments
 (0)