All Questions
Tagged with dynamic-programming graph
6 questions
2
votes
0
answers
140
views
Bellman-Ford algorithm implementation
I have used an adjacency list to represent the graph.
This implementation is based on the procedure given in the book 'Introduction to Algorithms'.
...
3
votes
2
answers
2k
views
LeetCode: Longest String Chain (Java)
For the question, I had a pretty messy solution so I would like some advice on how to better use Java to make the code a bit cleaner.
Also, a semi-hack that I did that I'm not proud of is checking if ...
3
votes
1
answer
950
views
Path Finding using Dynamic Programming
I was trying to implement a dp + graph problem. After completing the solution I tried to compare it with solution in tutorial to figure out which one was better and to find a way to improve mine if I ...
7
votes
1
answer
528
views
Hackerrank - Maximum Disjoint Subtree Product
Problem statement
We define an unrooted tree, T, with the following properties:
T is a connected graph with nodes ...
5
votes
1
answer
573
views
Snakes and Ladders using a magic die
This is a problem from here where you're given a magic die, and the objective is to find the minimum number of dice throws (hops) to go from the start point to the end of the board, and win the game.
...
3
votes
1
answer
500
views
Python graph challenge
I'm looking for ways to optimize a function that I wrote as an answer to this problem in Python:
You and your rescued prisoners need to get out of this collapsing death trap - and fast! ...