Re: moving data from one place to another in a text file
From: Robert Wagner (spamblocker-robert_at_wagner.net)
Date: 02/25/05
- Next message: Robert Wagner: "Re: moving data from one place to another in a text file"
- Previous message: LR: "Re: Cross-language challenge (of POSSIBLE interest)"
- In reply to: Richard: "Re: moving data from one place to another in a text file"
- Next in thread: Chuck Stevens: "Re: moving data from one place to another in a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 25 Feb 2005 02:04:03 GMT
On 24 Feb 2005 10:24:50 -0800, "Richard" <riplin@Azonic.co.nz> wrote:
>> A general version of the problem would call for
>> moving m lines, where m can be zero thru the file size (n)
>
>'Zero' and 'file size' means no lines moved. In fact the maximum of
>this specific type of problem is 'half the file'.
When output order is the reverse of input order, the number of lines
moved is n - 1. When records are shuffled like a deck of cards, the
number moved is n (unless you're planning to 'deal bottoms').
>> An example is sorting the file.
>
>The general solution to 'sorting the file' is sorting.
Sorting is a special case of Reordering Objects. The fastest way to
reorder objects in an ordered collection is to exchange pointers, as
opposed to physically moving the objects.
- Next message: Robert Wagner: "Re: moving data from one place to another in a text file"
- Previous message: LR: "Re: Cross-language challenge (of POSSIBLE interest)"
- In reply to: Richard: "Re: moving data from one place to another in a text file"
- Next in thread: Chuck Stevens: "Re: moving data from one place to another in a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|