The problem requires us to calculate the number of permutations of the set \( U = \{1,2,\ldots,n\} \) that separate subsets \( A \) and \( B \). Given that \( |A| = |B| = k \) and \( A \cap B = \varnothing \), we need to understand the condition under which the separation occurs. A permutation separates \( A \) from \( B \) if either all members of \( A \) precede all members of \( B \), or vice versa.
To solve this, consider any permutation of the \( n \) elements. Out of all possible permutations, each provides a unique ordering of elements. For a permutation to separate \( A \) from \( B \), the block of elements represented by \( A \) must appear entirely before or after the block represented by \( B \). Since arrangement within \( A \) and arrangement within \( B \) can occur freely within their respective groupings, the total ways to arrange all elements is simply: \[ n! \]
This is because any permutation of \( U \) will naturally separate \( A \) from \( B \) when viewed appropriately (either \( A \) is entirely before \( B \) or vice-versa). Therefore, no additional constraints beyond permuting all elements are required.
Thus, the number of permutations of \( U \) that separate \( A \) from \( B \) is: \(\boxed{n!}\)