Education + Jobs Hiring Website - 2025
0 like 0 dislike
30 views
saying in given graph , src---> dest ,each node has cost  , edge have latency(weight) , tell min cost to reach , such that latency<maxlatecy , got quite confused that time , i got dijkastra in mind  but in that time, felt it difficuilt to mold it acc. to need,

n no. of nodes
 m no. of edges
 m line with u ,v ,latency of channel (weight)
 
 u1 , v1 , w1
 ----
 um , vm , wm
 
 cost array of size n , for each node 0---n-1
 
 src , dest

max latency allowed
 
 6
 
 6
 
 0 1 10
 0 3 1
 1 2 10
 2 5 10
 3 4 10
 4 5 15
 
 5 1 2 20 20 3 (cost array)
 
 0 5
 
 30 (max latency allowed)
 
 output ---> 11 (0--->1--->2--->5)
ago in Online Assessments by (440 points) | 30 views

Please log in or register to answer this question.

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .