From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: [OFF TOPIC] Algorithms (was: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs.) Date: Fri, 13 Aug 2021 20:17:52 +0700 Message-ID: References: <87czqh3b8u.fsf@zoho.eu> <87pmuhze52.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16664"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 13 15:18:56 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEX5L-00042h-Gn for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 15:18:55 +0200 Original-Received: from localhost ([::1]:55478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEX5K-0005pr-A6 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 09:18:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEX4Y-0005pe-Oj for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 09:18:06 -0400 Original-Received: from mail-vk1-xa2e.google.com ([2607:f8b0:4864:20::a2e]:33598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEX4X-00015r-9y for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 09:18:06 -0400 Original-Received: by mail-vk1-xa2e.google.com with SMTP id 139so2550519vkx.0 for ; Fri, 13 Aug 2021 06:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=7IMpgx54jdCv0UDOTpCRNXK4LT6HxhrkF3nzgGEYun4=; b=B/iF8vEu+tZIXOPDIXI4o8X4K1DGmf7OUmThdRXNZawt2iGSnjORmYipDa45D2FjP2 T8ECy/xgUbrnXe3y9efEwOttst9sLQQ/4SaJ8w1JCmKERtLsVOsSRgBfzCh1nZs+XzJi ifUnkAX5Sz3JmszntMTMQ38uX2I6IfStL713fMAWlPzo/LoGCPUqM7TwjIo6xtqwFxMH BE616IywvEwZNXI5y+8D+gsR43goOS8hdgsuyzgi45r/8jsmnxU4qzqIXBT+sZQd2kNS gIOLmVwBsANd6pFYOKnw9OnNnFjkaUy8EMX2bkQKZBDyrjYvd+EPX6dEv3dHS5LEo7wl 2RLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=7IMpgx54jdCv0UDOTpCRNXK4LT6HxhrkF3nzgGEYun4=; b=DRz5UlN0MC/YNAqqawrW8faPS6F7T+Fotrt+zOgUbMzv7DgpeHtyU0KowAXOVXSNbc vgtgLVYlknlwe2TNrWt9GyLuB1X9eiVjIi9lVxd8vkmcegg3mfjSAOawMXmyVAKgLa8U CoJofGFd/lCEnAht1XWQbaJI19EZrCVnUwGKTslMdpIqV6oEaZ/ilZhV6e6XNhkzkUvC n2u2x8C9IuPYfDLIrzDE3WxRt9hRmpmxJ5MG0T0DPEp37KXRW5+E/azVrBdxjVsKh7U8 cvnazCvGUK2Yqh/sEILo9bz21+XjhqcN15jKGOqGgFcyllhIxINXBI1m/AtXHV156IYA b7JA== X-Gm-Message-State: AOAM531yN10so/gGcCfh/5VwbGafT551FyxsSB2wThPvWIgQzAJqTZXw +qeN+VX4iwgNRV2m5FSiTxTJ0ztt0/HvjUBWPSI= X-Google-Smtp-Source: ABdhPJyEnXC908Fpi5UU7eyGsSXdFYBTorydIz5x3k4NkKKRWCvC2knxs1lmtafmmu17WZr2IECAqcymLx/tD6FS3Aw= X-Received: by 2002:a1f:a314:: with SMTP id m20mr1473423vke.14.1628860683351; Fri, 13 Aug 2021 06:18:03 -0700 (PDT) In-Reply-To: <87pmuhze52.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::a2e; envelope-from=yurivkhan@gmail.com; helo=mail-vk1-xa2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132500 Archived-At: On Fri, 13 Aug 2021 at 20:08, Emanuel Berg via Users list for the GNU Emacs text editor wrote: > 2QdxY4RzWzUUiLuE wrote: > > Don't sort unless you have to. > *thumbs down* The advice is sound. Asymptotically, sorting in order to extract one longest (maximum, best) element is like firing a cannon at sparrows: sorting requires O(N*log(N)) comparisons but a single maximum value can be found in just O(N).