Content deleted Content added
WP:CHECKWIKI error fix. Fix code tag. Do general fixes and cleanup if needed. - using AWB (9429) |
Cosmoose312 (talk | contribs) No edit summary Tags: Mobile edit Mobile app edit Android app edit |
||
(11 intermediate revisions by 10 users not shown) | |||
Line 1:
{{Short description|Theoretical programming language for describing concurrent computations}}
{{about|the 1988 theoretical language|other uses|Unity (disambiguation)#Software{{!}}Unity § Software}}
{{multiple issues|
{{technical|date=September 2011}}
{{primary sources|date=July 2019}}
}}
'''UNITY''' is a programming language
== Description ==
Line 34 ⟶ 36:
You can sort in <math>\Theta(\log n)</math> time with rank-sort. You need <math>\Theta(n^2)</math> processors, and do <math>\Theta(n^2)</math> work.
Program ranksort
declare
Line 50 ⟶ 51:
A[R[i]] := A[i] >
end
===Floyd–Warshall algorithm===
Line 56:
Using the [[Floyd–Warshall algorithm]] all pairs [[Shortest path problem|shortest path]] algorithm, we include intermediate nodes iteratively, and get <math>\Theta(n)</math> time, using <math>\Theta(n^2)</math> processors and <math>\Theta(n^3)</math> work.
Program shortestpath
declare
Line 71 ⟶ 70:
k := k + 1 if k < n - 1
end
We can do this even faster. The following programs computes all pairs shortest path in <math>\Theta(\log^2 n)</math> time, using <math>\Theta(n^3)</math> processors and <math>\Theta(n^3 \log n)</math> work.
Program shortestpath2
declare
Line 88 ⟶ 85:
D[i,j] := min(D[i,j], <min k : 0 <= k < n :: D[i,k] + D[k,j] >) >
end
After round <math>r</math>, <code>D[i,j]</code> contains the length of the shortest path from <math>i</math> to <math>j</math> of length <math>0 \dots r</math>. In the next round, of length <math>0 \dots 2r</math>, and so on.
|