Tagged articles
binary search
33 articles · Page 1 of 1
This article explains why database indexes accelerate queries by detailing disk storage mechanics, demonstrating binary search on 100,000 records reducing block scans from 20,000 to 14, covering clustered vs non-clustered indexes, index trade-offs, common failure cases like OR conditions, and practical SQL optimization techniques.
B+TreeInterview questionsQuery Performance
0 likes · 14 min read

This article explains how database indexes accelerate queries by leveraging sorted data structures and binary search, detailing disk I/O mechanics, clustered vs. non-clustered indexes, index trade-offs on write performance, and common SQL optimization pitfalls like OR conditions and leading wildcards that cause index invalidation.
MySQLQuery PerformanceSQL Optimization
0 likes · 13 min read

The article explains how database indexes, built on sorted data and binary search, dramatically reduce query time compared to full table scans, while also covering storage fundamentals, the cost of excessive indexes, clustered indexes, index failure scenarios, and practical SQL optimization techniques.
SQL Optimizationbinary searchclustered index
0 likes · 12 min read

The article explains how database indexes work by comparing them to a book’s table of contents, describes underlying storage mechanisms, demonstrates binary search on sorted records, and discusses the benefits, trade‑offs, and common pitfalls of using clustered and non‑clustered indexes.
Database IndexesQuery PerformanceSQL Optimization
0 likes · 12 min read

This article explains the LeetCode 162 'Find Peak Element' problem, presents both linear scan and binary search solutions in Java, proves the existence of a peak, and details the algorithmic reasoning, time and space complexities, with full code examples.
AlgorithmJavaLeetCode
0 likes · 8 min read

This article explains how databases store data on various storage devices, why indexes dramatically improve query performance through sorted structures and binary search, and outlines practical SQL optimization techniques while warning about the trade‑offs of excessive indexing.
SQL Performancebinary searchclustered index
0 likes · 11 min read

This article explains how databases store data on various storage media, how indexes—especially clustered indexes—leverage sorted structures and binary search to dramatically reduce query time, and outlines best practices and pitfalls of index usage and SQL optimization.
Performance TuningSQL Optimizationbinary search
0 likes · 12 min read

The article reflects on the challenges of choosing college majors and then provides a comprehensive solution to LeetCode problem 1640, detailing the problem statement, examples, and multiple language implementations using sorting, binary search, and hash‑table techniques.
AlgorithmLeetCodearray reconstruction
0 likes · 9 min read

This article presents a curated collection of nine high‑utility C code snippets for embedded development, covering a circular buffer, custom assertions, bit reversal, fixed‑point arithmetic, endianness conversion, bit masks, timer handling, binary search, and a simple bitset structure, each with concise explanations and ready‑to‑use implementations.
Fixed-PointTimerbinary search
0 likes · 6 min read

This article introduces recursion, explains its definition and key characteristics, and demonstrates classic Python examples such as factorial calculation, Fibonacci sequence generation, and binary search, helping readers grasp how recursion simplifies complex problems compared to iterative loops.
AlgorithmFibonacciPython
0 likes · 8 min read

LeetCode 34 asks for the first and last indices of a target in a non‑decreasing integer array, returning [-1,-1] when absent, and can be solved in O(log n) time by applying two binary‑search passes—one locating the leftmost occurrence and the other the rightmost—illustrated with Java, C++, and Python implementations.
C++JavaLeetCode
0 likes · 8 min read

Binary search is an efficient O(log n) algorithm for locating elements in sorted arrays or intervals, and this article explains its basic principles, recursive and iterative implementations, handling of edge cases, applications such as log file indexing, and extensions to rotated arrays and variable‑length data.
Algorithmbinary searchiteration
0 likes · 18 min read

This article explains how to solve LeetCode problem 162 (Find Peak Element) in O(log n) time using a binary‑search approach, detailing the three possible cases, providing pseudocode, and presenting a complete Go implementation that handles boundary conditions as negative infinity.
AlgorithmGoLeetCode
0 likes · 4 min read

This article explains how computer storage works, why database indexes dramatically speed up queries, the mechanics of binary search, the differences between clustered and non‑clustered indexes, common pitfalls of over‑indexing, and practical SQL optimization strategies to avoid full table scans and index invalidation.
IndexSQL OptimizationStorage
0 likes · 12 min read

Binary search is an efficient O(log n) algorithm for locating a target value in a sorted array, and this article explains its step-by-step process, provides iterative and recursive PHP code examples, and discusses their usage and performance considerations.
AlgorithmO(log n)PHP
0 likes · 6 min read

This article explains the evolution of data storage, the fundamentals of computer storage devices, how database indexes function like a book's table of contents, the role of binary search, the benefits and drawbacks of indexes, and practical SQL optimization techniques to enhance query speed.
IndexQuery PerformanceSQL Optimization
0 likes · 12 min read

This article explains how data is physically stored, why database indexes dramatically speed up queries through sorted structures and binary search, discusses clustered versus non‑clustered indexes, their trade‑offs, and provides practical SQL optimization tips to avoid common pitfalls.
IndexSQL Optimizationbinary search
0 likes · 13 min read

This article explains how databases store data on various storage media, why indexes dramatically speed up queries through sorted structures and binary search, discusses different index types such as clustered indexes, and outlines common SQL optimization practices while warning against excessive indexing and typical pitfalls.
Performance TuningSQL Optimizationbinary search
0 likes · 12 min read

This article explains why locating a record in a B‑Tree index is crucial for MySQL InnoDB operations, describes scan intervals, index page structures, and details the step‑by‑step binary and sequential search process used to find the first matching record, including performance optimizations.
B-TreeIndex ScanInnoDB
0 likes · 28 min read

This article introduces the classic Two Sum problem, explains its brute‑force O(n²) approach, then presents an optimal O(n) hash‑table solution and a more advanced sort‑plus‑binary‑search method, providing complete C++ implementations and performance comparisons for each technique.
AlgorithmC++Quick Sort
0 likes · 8 min read

This article explains the classic two‑egg, 100‑floor interview puzzle, analyzes why it became a staple, and walks through four solution approaches—from a naïve linear method to binary search and a balanced partition strategy—culminating in a mathematically derived optimal method that never exceeds fourteen drops.
Algorithmbinary searchegg-drop
0 likes · 8 min read


21CTOOct 17, 2021 · Fundamentals
This article explores how to solve a common interview coding challenge—implementing a square‑root function without using library calls—by discussing problem analysis, linear and binary‑search approaches, optimization techniques, testing strategies, and the broader skills interviewers aim to assess.
AlgorithmInterviewbinary search
0 likes · 15 min read

This article explains how databases store data on physical storage devices, describes the role of indexes and binary search in accelerating query performance, discusses clustered versus non‑clustered indexes, outlines the trade‑offs of excessive indexing, and lists common SQL optimization techniques.
IndexSQL OptimizationStorage
0 likes · 12 min read


ITPUBJan 19, 2021 · Databases
This article explains how database indexes improve query performance by exploring binary trees, binary search, balanced trees, B‑trees, and B+‑trees, illustrating their structures, advantages, disadvantages, and the impact of disk I/O on overall efficiency.
B+TreeB-treeQuery Performance
0 likes · 17 min read


JavaEdgeNov 30, 2020 · Backend Development
This article explains Kafka's index architecture, the AbstractIndex class hierarchy, how entry sizes are chosen, the use of memory‑mapped files, the binary‑search algorithm for locating index entries, and a cache‑friendly improvement that reduces page faults and I/O latency.
IndexKafkabackend development
0 likes · 13 min read

This article explains the O(log N) efficiency of binary search, provides a clear template implementation in code, highlights common pitfalls, and presents two useful variants for finding the first equal or first greater‑or‑equal element in a sorted array.
AlgorithmCode Examplebinary search
0 likes · 7 min read

This article explains the binary search algorithm for locating a target element in a sorted array, describing its midpoint‑starting process, halving of the search range, termination conditions, and includes a simple example with its output.
Algorithmbinary searchfundamentals
0 likes · 3 min read

This article explains the classic binary search algorithm, shows how to find the first and last occurrence of a target in a sorted array, presents a combined solution, and extends the technique to efficiently locate elements in a rotated sorted array using one or two binary searches.
C++binary searchfirst occurrence
0 likes · 11 min read

This article presents a robust binary‑search template, explains why traditional implementations often fail, shows how to avoid overflow and infinite loops, and provides clear Java code and step‑by‑step guidance using real LeetCode problems as examples.
AlgorithmJavaLeetCode
0 likes · 27 min read

This article explains the classic binary search algorithm, presents a Java implementation, and details multiple binary‑search variants—including finding first/last equal elements, elements less than or greater than a key—while providing clear code examples and guidance on boundary handling.
Algorithmbinary searchcoding interview
0 likes · 9 min read

This article presents a JavaScript solution for locating the maximum element in a bitonic (first increasing then decreasing) array, explaining that the problem is a variant of binary search and providing a complete implementation using a binary‑search‑based algorithm.
AlgorithmJavaScriptbinary search
0 likes · 3 min read

Learn multiple techniques to calculate the square root of 2—including binary search, Newton’s iteration, and a clever C library implementation—through clear explanations, step‑by‑step illustrations, and full JavaScript and C code examples that reveal the underlying mathematics and performance considerations.
AlgorithmC++Newton's method
0 likes · 4 min read

This comprehensive guide explains linear search, binary search, bubble sort, insertion sort, selection sort, quicksort, and merge sort, detailing their concepts, step‑by‑step procedures, and providing complete, ready‑to‑run C code examples for each algorithm.
Quick SortSearch AlgorithmsSorting Algorithms
0 likes · 32 min read
