Deutsch   English   Français   Italiano  
<66EF8293.30803@grunge.pl>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: fir <fir@grunge.pl>
Newsgroups: comp.lang.c
Subject: Re: program to remove duplicates
Date: Sun, 22 Sep 2024 04:36:03 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <66EF8293.30803@grunge.pl>
References: <ecb505e80df00f96c99d813c534177115f3d2b15@i2pn2.org>	<vcnfbi$1ocq6$1@dont-email.me>	<8630bec343aec589a6cdc42bb19dae28120ceabf@i2pn2.org> <vcnu3p$1vkui$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
	logging-data="2951089"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
To: Lawrence D'Oliveiro <ldo@nz.invalid>
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <vcnu3p$1vkui$2@dont-email.me>
Bytes: 1700
Lines: 17

Lawrence D'Oliveiro wrote:
> On Sun, 22 Sep 2024 00:18:09 +0200, fir wrote:
>
>> ... you just need to read all files in
>> folder and compare it byte by byte to other files in folder of the same
>> size
>
> For N files, that requires N × (N - 1) ÷ 2 byte-by-byte comparisons.
> That’s an O(N²) algorithm.
>
> There is a faster way.
>
not quite as most files have different sizes so most binary comparsions
are discarded becouse size of files differ (and those sizes i read 
linearly when bulding lidt of filenames)

what i posted seem to work ok, it odesnt work fast but hard to say if it 
can be optimised or it takes as long as it should..hard to say