mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 11:26:25 +02:00
AD-5: 4a verbessert.
This commit is contained in:
@ -84,10 +84,8 @@ Jim Martens (6420323)}
|
|||||||
while (!empty(queue))
|
while (!empty(queue))
|
||||||
current = queue.dequeue()
|
current = queue.dequeue()
|
||||||
parent = current.parent
|
parent = current.parent
|
||||||
// wähle eines von beiden, abhängig davon,
|
distance = parent.getDistance() + w(parent,current)
|
||||||
// ob die Länge sich auf die Kanten oder die Gewichtungen bezieht (TBD)
|
current.setDistance(distance)
|
||||||
distance = parent.getDistance() + w(parent,current)
|
|
||||||
distance = parent.getDistance() + 1
|
|
||||||
if (distance > longestPath)
|
if (distance > longestPath)
|
||||||
longestPath = distance
|
longestPath = distance
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user