Talk:Bellman–Ford algorithm: Difference between revisions

Content deleted Content added
sizeof
Line 28:
 
In the worst case this algorithm uses O(V<sup>3</sup>) time in order to find single-source shortest paths. This is not very efficient. By a slight modification it can find all-pairs shortest paths in the same time. [[User:Tomo|Tomo]] 08:13, 16 December 2006 (UTC)
 
== sizeof ==
 
Comparing sizeof(int) and sizeof *distance form which both acomplish the same thing. The former form is much more idiom and recognisable to most programmers, the second is a less common form. Indeed the [http://publications.gbdirect.co.uk/c_book/chapter5/sizeof_and_malloc.html The C Book] says the form without brackets is rarely used. This particular instance is confusing for two reasons a) the * could be mistaken for multiplication b) as distance is declared on the same line it provokes the question as to whether the compiler knows about the size of *distance yet. If we are aiming more maximum comprehensability the former seems perferable. --[[User:Salix alba|Salix alba]] ([[User talk:Salix alba|talk]]) 00:55, 19 May 2007 (UTC)