Skip to content

Commit e1c2005

Browse files
committed
Update graph alogorithms
1 parent f396f4b commit e1c2005

File tree

59 files changed

+2097
-665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2097
-665
lines changed

README.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ List of Programs related to data structures and algorithms
1111
### Queue
1212
1. Queue using array: [JavaScript](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/queue/queue_array.js)
1313
2. Queue using linkedlist: [JavaScript](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/queue/queue_with_linkedlist.js)
14-
3. Queue using stack: [JavaScript]()
1514

1615
### SinglyLinkedlist
1716
1. SinglyLinkedlist implementation: [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/singlyLinkedList/singlyLinkedList.js) [Playground](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/singlyLinkedList/singlyLinkedList.js) [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/singlyLinkedList/singlyLinkedList.md)
@@ -21,11 +20,11 @@ List of Programs related to data structures and algorithms
2120
1. DoublyLinkedlist implementation: [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/doublyLinkedlist/doublyLinkedlist.js) [Playground](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/doublyLinkedlist/doublyLinkedlist.js) [Documentation](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/doublyLinkedlist/doublyLinkedlist.md)
2221

2322
### Tree
24-
1. Binary Search Tree: [JavaScript](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/trees/binary_search_tree.js)
23+
1. Binary Search Tree: [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/trees/binary_search_tree.js) [JavaScript](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/trees/binary_search_tree.js) [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/trees/binary_search_tree.js)
2524

2625
### Graphs
2726

28-
1. Unweighted undirected graph: [JavaScript](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/graphs/unweighted_undirected.js)
27+
1. Unweighted undirected graph: [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/graphs/unweightedUndirected/unweighted_undirected.js) [Playground](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/graphs/unweightedUndirected/unweighted_undirected.js) [Documentation](https://livecodes.io/?console=open&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/datastructures/graphs/unweightedUndirected/unweighted_undirected.md)
2928

3029
### HashTable
3130

@@ -155,21 +154,16 @@ List of Programs related to data structures and algorithms
155154

156155
### Graph
157156

158-
1. Clone graph: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/cloneGraph.js)
159157

160-
2. Course schedule: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/courseSchedule.js)
161-
162-
3. Pacific Atlantic waterflow: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/pacificAtlantic.js)
163-
164-
4. Number of Islands: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/numberOfIslands.js)
165-
166-
5. Longest consecutive sequence: [JavaScript](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/longestConsecutiveSequence.js)
167-
168-
6. Alien dictionary: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/alienDictionary.js)
169-
170-
7. Graph valid tree: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/graphValidTree.js)
171-
172-
8. Number of connected components in an undirected graph: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/numberOfConnectedComponents.js)
158+
| No. | Name | Source | Live | Documentation | Level | Pattern |
159+
| :-: | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----: | :-------------------------------: |
160+
| 1 | Clone graph | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/1.cloneGraph/cloneGraph.js) | [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/1.cloneGraph/cloneGraph.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/1.cloneGraph/cloneGraph.js) | Medium | Depth-First-Search(DFS) using recursion |
161+
| 2 | Course schedule | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/2.courseSchedule/courseSchedule.js) | [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/2.courseSchedule/courseSchedule.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/2.courseSchedule/courseSchedule.md) | Medium | DFS using recursion |
162+
| 3 | Pacific Atlantic waterflow | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/3.pacificAtlantic/pacificAtlantic.js) | [Playground](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/3.pacificAtlantic/pacificAtlantic.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/3.pacificAtlantic/pacificAtlantic.md) | Medium | DFS using recursion |
163+
| 4 | Number of Islands | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/4.numberOfIslands/numberOfIslands.js) | [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/4.numberOfIslands/numberOfIslands.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/4.numberOfIslands/numberOfIslands.md) |Medium | DFS using recursion |
164+
| 5 | Alien dictionary | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/5.alienDictionary/alienDictionary.js) | [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/5.alienDictionary/alienDictionary.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/5.alienDictionary/alienDictionary.md) |Hard | Kahn's algorithm for topological sorting |
165+
| 6 | Graph valid tree | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/6.graphValidTree/graphValidTree.js) | [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/6.graphValidTree/graphValidTree.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/6.graphValidTree/graphValidTree.md) | Medium | Union Find algorithm(+ union by rank & path compression) |
166+
| 7 | Number of connected components in an undirected graph | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/7.numberOfConnectedComponents/numberOfConnectedComponents.js) | [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/7.numberOfConnectedComponents/numberOfConnectedComponents.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/graph/7.numberOfConnectedComponents/numberOfConnectedComponents.md) | Medium | Union Find algorithm(+ union by rank & path compression) |
173167

174168
### Matrix
175169

@@ -193,6 +187,11 @@ List of Programs related to data structures and algorithms
193187

194188
### Hashtable
195189

190+
<!--| No. | Name | Source | Live | Documentation | Level | Pattern |
191+
192+
| 6 | Longest consecutive sequence | [Source](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/hashtable/6.longestConsecutiveSequence/longestConsecutiveSequence.js) | [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/hashtable/6.longestConsecutiveSequence/longestConsecutiveSequence.js) | [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/hashtable/6.longestConsecutiveSequence/longestConsecutiveSequence.md) | | |
193+
-->
194+
196195
1. Duplicates: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/hashtable/duplicates.js)
197196

198197
2. Two sum: [JavaScript](https://livecodes.io/?console&x=https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/hashtable/twoSum/twoSum.js) [Documentation](https://github.com/sudheerj/datastructures-algorithms/blob/master/src/javascript/algorithms/hashtable/twoSum/twoSum.md)

src/images/clonegraph1.png

10.7 KB
Loading

src/images/clonegraph2.png

3.51 KB
Loading

src/images/graph.png

25.2 KB
Loading
11.9 KB
Loading
17.1 KB
Loading

src/images/numberOfIslands.png

8.6 KB
Loading

src/images/pacific-atlantic.png

23.9 KB
Loading

src/images/valid-tree.png

36.1 KB
Loading

src/java1/algorithms/graph/AlienDictionary.java

-66
This file was deleted.

src/java1/algorithms/graph/CloneGraph.java

-91
This file was deleted.

src/java1/algorithms/graph/CourseSchedule.java

-51
This file was deleted.

0 commit comments

Comments
 (0)