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: 
If you know how to merge 2 arrays, then you can merge any number of arrays ;)
Yes, it is possible and for `k` arrays it's usually done using a priority queue of size `k`. The queue holds one element from each array (together with a tag for remembering which array the element came from.) 

Initially the queue is filled with the minimal element from each array. Then you just iteratively remove the minimal element from the queue, and add next element to the queue, from the array the last minimal element came from.

Assuming the standard heap implementation of the pqueue, this yields O(nlog(k)) complexity.