# Copyright (c) 1990 The Regents of the University of California.
# This code is derived from software contributed to Berkeley by
# %sccs.include.redist.sh%
# @(#)median.awk 5.2 (Berkeley) %G%
# print out the median time to each hop along a route.
for (f =
5; f
<=
NF; ++f
) {
# insertion sort the times to find the median
for (i =
2; i
<= n
; ++i
) {
if (n
> 1 && (n %
2) ==
0)
median =
(time
[n
/2] + time
[(n
/2) + 1]) / 2