Tagged articles
time complexity
32 articles · Page 1 of 1
This article reveals how C++ STL containers like vector, list, map, and unordered_map incur hidden performance costs through memory layout, cache locality, pointer chasing, and rehash overhead, demonstrating that theoretical time complexity often misleads because cache misses dominate real-world performance.
C++Memory LayoutSTL
0 likes · 13 min read

This article explains how to determine whether an integer array contains any duplicate values using a PHP solution that leverages an associative map to achieve linear time and space complexity, complete with example inputs, detailed code walkthrough, and complexity analysis.
AlgorithmPHParray
0 likes · 4 min read

This article explains the problem of finding the longest substring without repeating characters, demonstrates a brute‑force O(n³) solution with code, then introduces an optimized sliding‑window approach that runs in linear time O(n), including detailed implementation, complexity analysis, and key insights.
AlgorithmStringbrute-force
0 likes · 5 min read

This guide explains how to determine whether an integer array contains any duplicate values by iterating once, using a PHP associative array to track seen elements, and returning true on the first repeat or false if all elements are unique, with detailed code, step‑by‑step flow, and complexity analysis.
array algorithmduplicate detectiontime complexity
0 likes · 4 min read

The article critiques absurd interview questions, then presents a practical Java solution for compressing strings by replacing consecutive characters with their counts, explains the algorithm’s O(n) time and O(1) extra space, discusses edge cases like multi‑digit counts and Unicode handling, and offers implementation tips.
AlgorithmJavaString Compression
0 likes · 6 min read

This article explains how to efficiently detect duplicate elements in a PHP integer array using an O(n) algorithm, detailing the solution class, step‑by‑step execution flow, and its linear time and space complexities.
array algorithmduplicate detectionspace complexity
0 likes · 4 min read

This article explains how to determine whether an integer array contains any duplicate values using a PHP solution that iterates the array, stores seen elements in an associative map, and returns true on the first repeat, with O(n) time and space complexity.
AlgorithmPHParray
0 likes · 4 min read

This article explains how to identify the single non‑repeating integer in a list where every other number appears twice, using an O(n) time and O(1) space XOR‑based algorithm, complete with Go code, step‑by‑step analysis, complexity discussion, and UML activity diagram.
Algorithmgolangspace complexity
0 likes · 6 min read

This article explains how to determine whether an integer array contains duplicate values by iterating through the elements, using a PHP associative array for constant‑time lookups, and provides the full solution code along with its execution flow, time and space complexity analysis.
AlgorithmPHParray
0 likes · 4 min read

This article explains how to determine whether an integer array contains duplicate values by traversing the array with a PHP solution that uses an associative map, and it details the algorithm's execution flow, time and space complexity, and provides sample inputs and outputs.
PHPduplicate detectionspace complexity
0 likes · 4 min read

This article explains how to efficiently find the k most frequent elements in an integer array using a bucket‑sort based algorithm that runs in linear O(n) time, detailing problem constraints, conventional O(n log n) approaches, the optimized method, Go implementation, complexity analysis, and test results.
Algorithmbucket sorttime complexity
0 likes · 7 min read

This article walks through the CPython source code that defines list’s built‑in methods—append, insert, pop, index, count, remove, reverse, clear, and copy—explaining how each method is wired into the type object, the underlying C logic, time‑complexity characteristics, and common pitfalls such as reference‑count handling and shallow versus deep copying.
Deep CopyListPython
0 likes · 28 min read

This article explains how to determine whether an integer array contains duplicate values by iterating through each element, using a PHP associative array to track occurrences, and returning true if any value appears at least twice, with detailed code, execution flow, and time‑space complexity analysis.
array algorithmduplicate detectionspace complexity
0 likes · 4 min read

This article explains how to determine whether an integer array contains any duplicate values by iterating through the elements, using a hash map for constant‑time lookups, and provides a PHP implementation of the containsDuplicate function along with its time and space complexity analysis.
Algorithmarrayduplicate detection
0 likes · 4 min read

This article explains how to determine whether an integer array contains duplicate values by iterating through each element, using a PHP class with a containsDuplicate method that employs an associative array for O(n) time and space complexity, and provides example inputs and detailed execution flow.
PHPduplicate detectionspace complexity
0 likes · 4 min read

This article walks through a step‑by‑step interview scenario where a candidate solves the classic Two Sum problem, starting with a naïve nested‑loop approach, then improving it using a hash‑map to achieve linear time complexity, and discusses edge cases and code refinements.
JavaTwo Sumalgorithm interview
0 likes · 7 min read

This article explains why LeetCode submissions often receive Time Limit Exceeded errors, covering inefficient algorithms, infinite loops, redundant calculations, unsuitable data structures, and poor I/O handling, and illustrates common examples with specific problems and more efficient solutions.
AlgorithmLeetCodeTLE
0 likes · 5 min read

This article explains the concepts of time and space complexity, demonstrates their practical measurement with Python's list and set structures, and compares their lookup speed and memory consumption using concrete code examples and empirical results.
Pythondata structuresspace complexity
0 likes · 6 min read

This article explains a classic interview question of locating the smallest missing positive integer from an array, analyzes its theoretical bounds, and presents three O(n) time, O(1) space solutions—including a clever marking technique and a swap‑based method—accompanied by complete Go implementations.
AlgorithmInterviewmissing-number
0 likes · 7 min read

The article explains skip list fundamentals, shows how probabilistic multi‑level indexing yields O(log n) search and O(n) space, provides a complete Go implementation with insertion, deletion and search functions, compares Redis’s enhanced skip list used in sorted sets, and answers common design questions.
Go ProgrammingIndex structureRedis
0 likes · 17 min read

This article introduces the sliding window algorithmic technique, explains its relation to TCP flow control, demonstrates its implementation with Java code for maximum subarray sum, longest substring without repeats, and minimum window substring problems, and provides a reusable framework for solving similar LeetCode challenges.
AlgorithmLeetCodesliding window
0 likes · 10 min read

This article explains the merge sort algorithm’s divide‑and‑conquer principle, analyzes its O(n log n) time complexity, and provides two complete C# code examples—one for a generic merge sort and another for merging two already sorted arrays—along with visual illustrations of the merging process.
AlgorithmC++Divide and Conquer
0 likes · 6 min read

This article explains the concept of constant‑time operations, introduces Big O notation for describing algorithmic time complexity, and demonstrates how to calculate and interpret complexities such as O(1), O(N), O(N²) and O(N²·logN) through clear Java code examples.
Big OJavaalgorithm analysis
0 likes · 7 min read

This article shares the author’s personal insights on a book about algorithms, data structures, and complexity, explaining core concepts such as algorithm definition, common data structures, time and space complexity, and offering intuitive examples to aid understanding.
AlgorithmsComplexitydata structures
0 likes · 12 min read

This article introduces the core concepts of algorithms, covering their definition, five essential properties, design principles such as correctness and readability, methods for analyzing time and space complexity, common complexity classes, and a variety of algorithmic strategies including recursion, dynamic programming, greedy and divide‑and‑conquer techniques.
AlgorithmComplexityDesign Principles
0 likes · 23 min read

This article introduces recursion, explains its core principles, presents a general problem‑solving approach, and walks through multiple practical examples—from factorial and climbing stairs to binary tree inversion and the Tower of Hanoi—while analyzing time and space complexities and offering optimization techniques.
AlgorithmDivide and ConquerJava
0 likes · 23 min read

This article systematically presents ten classic sorting algorithms—bubble, selection, insertion, quick, heap, merge, shell, counting, bucket, and radix—detailing their concepts, time and space complexities, step‑by‑step logic, animated illustrations, and complete source code examples in C++ and JavaScript.
C++JavaScriptSorting Algorithms
0 likes · 19 min read

This article explains the concept of recursion, presents a universal four‑step solving method, and walks through multiple practical examples—from factorials and frog‑jump problems to binary‑tree inversion, Tower of Hanoi, and cellular division—while detailing time and space complexity analyses and optimization strategies.
binary treedynamic programmingrecursion
0 likes · 22 min read

The article uses the plot of the historical series “The Longest Day in Chang’an” to explain how proper use of data structures, recommendation algorithms, and time‑complexity optimizations—such as O(n²) brute‑force search, O(n) mapping, and O(log n) spatial tricks—can turn a desperate race against time into a successful mission, while also touching on big‑data analysis and simple encryption via the tower‑signal system.
Algorithmsencryptionrecommendation systems
0 likes · 4 min read

This article introduces sorting algorithms, distinguishing internal and external sorting, listing major internal sorts, explaining their time‑complexity categories and stability properties, and providing visual illustrations for each algorithm along with a reference to an open‑source implementation.
Sorting Algorithmsalgorithm fundamentalsdata structures
0 likes · 3 min read

This article explains the meaning of Big O notation—O(n), O(1) and O(log n)—using intuitive box-and‑card analogies, shows how Redis command complexities are expressed, and highlights why constant‑time operations are the most efficient for large data sets.
AlgorithmBig ORedis
0 likes · 5 min read

This article introduces eight fundamental internal sorting algorithms—Insertion, Shell, Selection, Bubble, Merge, Quick, Heap, and Radix—explaining their principles, step‑by‑step procedures, time and space complexities, and stability characteristics to help readers choose the right method for different data sets.
Sorting Algorithmsalgorithm analysisdata structures
0 likes · 14 min read
