Skip to content

Commit

Permalink
Added a conditional check for unreachable vertices by replacing infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
msimey committed Oct 11, 2024
1 parent 80d3d7d commit 379af85
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2850,3 +2850,8 @@
- Bio: Third Year undergrad pursuing B.tech in Electronics and communication Engineering
- GitHub: [op-amateur](https://github.com/op-amateur)

#### Name: [Simran](https://github.com/simran0963)

- Place: Dehradun, Uttarakhand, India
- Bio: final Year undergrad pursuing B.tech in Computer Science and Engineering
- GitHub: [simran0963](https://github.com/simran0963)
6 changes: 5 additions & 1 deletion PROJECTS/Dijkstra's algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ def dijkstra(graph, start):
shortest_distances = dijkstra(graph, start_vertex)

for vertex, distance in shortest_distances.items():
print(f'Shortest distance from {start_vertex} to {vertex} is {distance}')
if distance == float('infinity'):
print(f'Shortest distance from {start_vertex} to {vertex} is unreachable')
else:
print(f'Shortest distance from {start_vertex} to {vertex} is {distance}')

28 changes: 28 additions & 0 deletions profiles/Simran.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Simran Mehta
### Location

Dehradun, Uttarakhand

### Academics

Graphic Era Hill University, Dehradun

### Interests

- Web development
- DSA
- AI/ML

### Development

- Front-end web development using React

### Projects

- [Hotstar Clone](https://github.com/simran0963/hotstar-clone) This website is a copy of the original Hotstar web application


### Profile Link

[Simran Mehta](https://github.com/simran0963)-Github
[Simran Mehta](https://www.linkedin.com/in/mehtasimran/)-LinkedIn
6 changes: 6 additions & 0 deletions scripts/heallo_world_simran0963.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// LANGUAGE: Javascript
// ENV: React.js
// AUTHOR: Simran Mehta
// GITHUB: https://github.com/simran0963

console.log('Hello, World!');

0 comments on commit 379af85

Please sign in to comment.