Tagged articles

Custom Sorting

4 articles · Page 1 of 1
IT Services Circle
IT Services Circle
Sep 13, 2026 · Fundamentals

LeetCode 761: Special Binary String — Recursive Decomposition & Custom Sort Proof

This article analyzes LeetCode 761 Special Binary String, proving that valid strings decompose into minimal '1...0' units, then achieves maximum lexicographical order through recursive substring sorting and a custom comparator proven to satisfy total order properties (completeness, antisymmetry, transitivity), with Java, C++, and TypeScript implementations.

AlgorithmCustom SortingLeetCode 761
0 likes · 12 min read
LeetCode 761: Special Binary String — Recursive Decomposition & Custom Sort Proof
Mingyi World Elasticsearch
Mingyi World Elasticsearch
Jan 14, 2025 · Databases

How to Build a Custom Elasticsearch Query that Sorts by Time Buckets and Relevance

This article walks through creating a custom Elasticsearch 8.x query that first groups documents into time buckets (e.g., within 3 days, 4‑7 days, older) using a pre‑computed time_bucket field, then sorts each bucket by the _score relevance of the content field, covering pipeline definition, mapping, sample data, DSL query, and practical considerations.

Custom SortingDSL queryElasticSearch
0 likes · 11 min read
How to Build a Custom Elasticsearch Query that Sorts by Time Buckets and Relevance
Test Development Learning Exchange
Test Development Learning Exchange
Sep 19, 2024 · Fundamentals

Custom Sorting in Python

This article introduces various methods to customize sorting in Python, including using sorted() function, list's .sort() method, and custom comparison functions.

Custom SortingKey FunctionsPython
0 likes · 8 min read
Custom Sorting in Python