Question: I am using a batch script for getting the latest version of specific projects. This script only runs tf.exe and gets the latest version of some Binaries. Everything works fine, but I would like to change the attrib of the downloaded files to be writeable (by deafult these files are read-only). For that I want to determine the local path of the files and use the attrib-command from batch.

tf.exe workfold [Workspace] shows me the local path in some kind of listing but it would be easier, if it only shows me what I want so I can use the prompt. Until now the it looks like this:

```
tf.exe workfold [Workspace]

=======================================

Arbeitsbereich: XYZ-xxxxxx (Username)

Auflistung: TFS-URL

[Workspace]:  C:\xxx\TFS\xxx

```

Is it possible to determine only the local path mapping of a TFS Workspace so that I can use the prompt for the attrib-command without parsing?

Answer: 
Though it is possible to iteratively merge arrays, a more efficient way will be a [**k-way merge**](http://code.google.com/p/kway/), which is done in `O(nlogk)` where `k` is the number of arrays and `n` is the total number of elements, using a priority queue.

Note: **It cannot be done better then `O(nlogk)`**, because if it was possible [let's say with complexity `O(g(n))` where `g(n)` is as asymptotically weaker then `nlogn`] - then we can produce the following sorting algorith:

```
sort(array A):
  split A into n arrays, each of size 1, B1,...,Bn
  A <- special_merge(B1,...Bn)
  return A

```

It is easy to see that this algorithm is of complexity `O(g(n) + n) = O(g(n))`, and we get a contraditcion, since we got a sort better then `O(nlogn)` - which is not possible with compartions based algorithms, since this problem is `Omega(nlogn)`
Sure, merge array 1 with array 2, merge array 1+2 with array 3, merge array 1+2+3 with array 4, continute until you have no arrays left. All you need is a method to merge 2 arrays, and a method to call this with a list of arrays until the list is empty.