This article introduces Python lists, explains their core operations such as adding, removing, searching, sorting, and iterating, and provides ten detailed code examples that illustrate common use cases and scenarios for effective list manipulation.
This article provides a comprehensive guide to PHP arrays, covering how to create them with array() or short syntax, initialize numeric arrays with range(), convert variables using compact(), and demonstrates accessing, adding, modifying, deleting, traversing with loops, and using built‑in functions, while also introducing related data structures.
The article explains that programming is fundamentally the combination of algorithms and data structures, breaks algorithms into control and logic, and argues that separating logic, control, and data—along with mastering essential design principles and data structures—is key to writing high‑quality, maintainable code.
Redis stores data directly in memory rather than on disk, leveraging microsecond‑level access, a single‑threaded Reactor event loop with I/O multiplexing, optimized data structures like strings, hashes, lists, sets, and a simple text protocol, all of which combine to deliver exceptionally high performance for high‑frequency read/write workloads.
This article explains practical Python implementations for reversing a linked list using iterative and recursive approaches, merging two or multiple sorted linked lists, handling edge cases such as empty inputs, and includes complete code samples with complexity analysis for each method.
This article demonstrates how to improve the performance of nested for‑loops that match user IDs between two large lists by adding a break statement and by converting the inner list into a hash map, reducing execution time from tens of seconds to a few seconds.
This article explores powerful PHP data structures and algorithms—including binary search, hash tables, linked lists, stacks, queues, and binary trees—demonstrating their implementations, performance optimization strategies, and the modern Laravel Collections approach to efficiently handle large-scale data in web development.
This article explains various Python sorting techniques—including the built‑in sorted() function, the in‑place list.sort() method, key‑based sorting for complex structures, multi‑criteria ordering, and custom comparison via functools.cmp_to_key—providing clear code examples for each approach.
This article explains the purpose, design, and internal data structures of ext4 extents, describes how the B+‑tree indexes extents for efficient mapping of logical to physical blocks, and compares ext4’s extent mechanism with older file‑system addressing methods and other modern file systems.
This article examines core and advanced data structures in PHP and Laravel, demonstrating how arrays, associative and multidimensional arrays, collections, and JSON storage can be leveraged with practical code examples and query‑optimization techniques to build efficient, scalable, and maintainable web applications.
This article explains how MySQL's indexing evolved from simple binary search trees through AVL and red‑black trees to B‑trees and finally B+ trees, highlighting the performance and I/O advantages that make B+ trees the preferred index structure for disk‑based databases.
Redis achieves remarkable speed by storing data entirely in memory, employing a single‑threaded event loop with I/O multiplexing, and using highly optimized in‑memory data structures while balancing durability through efficient persistence mechanisms, all of which combine to minimize latency and maximize throughput.
This article presents a detailed guide to classic sorting, searching, and encryption algorithms, explains their principles and use cases, and provides Python implementation links and visualizations, offering a valuable resource for learners seeking to master fundamental algorithmic techniques.
This article presents a collection of practical Python techniques—including one‑line variable swapping, list, set and dictionary comprehensions, the Counter class for counting, pretty‑printing JSON, inline conditional expressions, list slicing, itertools combinations, and a quirky False‑equals‑True example—each illustrated with concise code snippets and explanations.
The article details Tencent’s updated 15‑month compensation packages for 2025 backend roles, outlines a one‑hour interview covering OS process/thread concepts, sorting algorithms, MySQL storage engines and indexing, Redis data structures, Java collections, and compares RocketMQ with Kafka for reliable messaging.
This guide outlines the core data structures—arrays, 2D arrays, queues, linked lists, stacks, trees, and hash maps—explaining their characteristics, typical use‑case scenarios, and concrete examples to help embedded developers write efficient, scalable code.
This tutorial walks through thirty practical Python dictionary operations—from creating and accessing entries to merging, comprehensions, sorting, and deletion—providing clear code examples and expected outputs to help readers master this versatile data structure.
The article honors the late Tsinghua professor Yan Weimin, highlighting her pioneering role in Chinese computer science, the lasting impact of her co‑authored Data Structures textbook, and the rigorous standards that shaped generations of computing talent.
Chinese Computing HistoryData StructuresTsinghua University
This article explains why storing daily sign‑in data in a traditional database can cause performance issues at scale and demonstrates how Redis bitmap, a memory‑efficient bit‑level structure, can record and compute continuous user sign‑ins both by date and by user.
The article explains how to store and deduplicate billions of identifiers by using a bitmap to represent presence with a single bit per value, calculates memory requirements, shows Redis bitmap commands, and introduces Bloom filters as an extension with multiple hash functions for efficient large‑scale data handling.
This article demonstrates how replacing a naïve double‑for‑loop that matches two large lists of users with a HashMap lookup dramatically cuts execution time from tens of seconds to a few seconds by reducing the algorithmic complexity from O(n²) to O(n).
This article explains Bloom filters and Cuckoo filters, covering their principles, implementations, and practical applications in database optimization.
This article explains the bitmap (BitVec) data structure, its memory efficiency for handling billions of integers, real‑world applications such as bloom filters and permission flags, and walks through Go’s internal BitVec implementation with concrete code examples and performance insights.
Redis achieves millisecond‑level latency by storing all data in memory, using specially optimized data structures such as SDS, incremental‑rehash hash tables, and ziplists, employing a single‑threaded event‑driven model with epoll‑based I/O multiplexing, and streamlining network communication through the compact RESP protocol, compression, and batching, while also offering flexible eviction and persistence strategies.
This article explains the treap data structure—its BST and heap properties, random priority balancing, and implementation details—then dives into Go's runtime semaRoot treap, showing step‑by‑step enqueue and dequeue algorithms with code, rotations, and performance reasoning.
This article explains the treap data structure, detailing how each node stores a key and a priority to satisfy both binary‑search‑tree ordering and heap ordering, and walks through insertion, rotation, deletion, and a full Python implementation with concrete examples.
Redis’s evolution from linked lists to ziplist, quicklist, and the newer listpack is examined in depth, highlighting their structures, memory‑performance trade‑offs, operational details, and practical guidance for Java developers on choosing the right data structure for different workloads.
This article explains how Redis Bitmap stores binary states using bit arrays, details its commands and use cases, then introduces Bloom Filter's probabilistic set membership, compares their advantages, limitations, and typical scenarios such as cache penetration protection and blacklist filtering.
This article dissects Go's runtime GPM model and the lock‑free runq data structure, detailing its fields, core operations such as runqput, runqget, runqgrab, and their atomic implementations, while also comparing local and global queues and illustrating the code paths with concrete examples.
This article combines a Huawei campus recruitment overview—including interview timeline, salary grades, and interview process—with extensive technical Q&A covering Java vs C differences, Java features, OOP concepts, common design patterns, Redis and MySQL comparisons, MySQL transaction properties, B‑Tree indexes, list deduplication, stack implementations, and the low‑level workings of the ping command.
The article explains how to use a max‑heap together with backtracking and a greedy strategy in Python to recommend the top three attractions with the highest scores while keeping the total travel distance under 20 km, and discusses the algorithm's steps, example execution, and limitations.
This article explains how Redis implements dynamic string expansion using the Simple Dynamic String (SDS) structure, detailing the sdsMakeRoomFor function, its allocation strategy, type handling, and the architectural changes introduced in Redis 7.0.
This article provides a comprehensive overview of essential Python concepts—including decorators, list comprehensions, generators, exception handling, modules, threading, shallow and deep copying, garbage collection, variable arguments, closures, method types, process‑thread differences, relational vs NoSQL databases, array vs linked‑list structures, and the distinction between HTTP and Web Service API testing—illustrated with clear explanations and runnable code examples.
This comprehensive guide walks you through Python's core data structures—including lists, stacks, queues, linked lists, trees, heaps, and graphs—explaining their characteristics, common operations, and step‑by‑step code examples, while also covering related algorithms such as recursion, depth‑first and breadth‑first search, cycle detection, and Dijkstra's shortest‑path algorithm.
This article explains Guava's RangeSet API, detailing its automatic range merging, logarithmic‑time queries, flexible set operations, underlying range‑tree implementation, and provides a complete Java example that demonstrates creation, manipulation, and iteration of range collections.
This article explains PHP's array_values() function, demonstrating how it returns a new array with reindexed numeric keys for both indexed and associative arrays, and highlights that the returned array is a copy, not a reference, with practical code examples.
The article explains Guava’s Table data structure—a two‑key map—covers its main implementations, provides a complete Java demo for creating, querying, updating, and iterating tables, compares it with nested maps, and highlights its type safety, usability, memory efficiency, and immutability advantages.
This tutorial explains Python dictionaries in depth, covering their definition, how to create, access, modify, add, delete, copy, traverse, and nest dictionary entries, with clear code examples for each operation to help beginners master this essential data structure.
The article explains Google Guava’s RangeMap—a map that links non‑overlapping ranges to values—detailing its core features, typical use cases such as retry mechanisms and tiered pricing, and provides step‑by‑step Java code examples that show insertion, querying, overlapping handling, sub‑range views, and removal.
This article presents a curated collection of high‑impact C utility code examples—including a circular buffer, assertion macro, bit‑reversal function, fixed‑point arithmetic, endianness conversion, bit masks, timer handling, binary search, and a simple bitset—explaining their purpose and showing ready‑to‑use implementations for embedded systems.
This article provides a comprehensive analysis of Java's ConcurrentHashMap, covering its underlying data structures, key attributes, core components such as Node, ForwardingNode, TreeBin, and TreeNode, and detailed explanations of the put, get, hash, and resizing algorithms with annotated source code examples.
This article introduces core Python concepts—including dictionaries and sets as key‑value and unique collections, file and directory manipulation with the os module, regular expression handling, logging setup, unit testing with unittest, performance profiling via cProfile, and using popular third‑party libraries such as requests and BeautifulSoup.
This article explains the internal structures of Redis data types—including strings, lists, sets, hashes, and sorted sets—detailing their memory representations, evolution across versions, time‑complexity characteristics, and the code implementations that enable efficient in‑memory operations.
This article explains Python's set type, covering its typical use cases, core API methods, and a deep dive into the CPython C implementation—including the PySetObject layout, hash table mechanics, field behavior, and differences from dictionaries.
This article explains the concept of deep copy in Python, demonstrating how it recursively copies all nested objects using the copy module's deepcopy function, with practical examples including basic data types, lists, dictionaries, and custom objects.
This article explains Python's set type, covering its definition, creation (including empty sets), key properties such as unordered uniqueness, conversion using set(), the eight basic and four augmented set operators, common set methods, and practical applications like data deduplication.
This article introduces the Redis in‑memory database, highlights the new "Redis Mastery" book that blends theory with practical examples, and explains core concepts such as SDS string structures, RDB/AOF persistence, master‑slave replication, and Sentinel high‑availability mechanisms.
The article chronicles the time wheel algorithm from its 1997 origins, explains simple, round‑based, and hierarchical wheel designs, compares them to queue timers, details Dubbo’s HashedWheelTimer implementation, and shows how combining the wheel with a delay‑message queue can dramatically improve service scalability and efficiency.
This guide explains how Python’s built‑in zip() and dict() functions can be combined to pair elements from two separate lists and create a dictionary, covering function basics, step‑by‑step examples, practical use cases such as user credentials and student scores, and a concise summary of the technique.
This article dissects the CPython implementation of three dictionary methods—get, setdefault, and popitem—showing example usage, walking through the C source code, explaining hash look‑ups, entry handling, and the subtle state changes that occur when keys are missing or removed.
This article explains Java's EnumMap, covering its definition, key characteristics, how to create and use it with code examples, its efficient array‑based implementation, and practical test cases, demonstrating why EnumMap is a high‑performance map for enum keys in backend development.
This article explains how to design a flexible TreeNode interface and a TreeUtil class in Java that convert flat collections into hierarchical tree structures, provides multiple static methods for object and JSON tree generation, and discusses optimization techniques for large data sets.
This article dissects CPython's dictionary implementation, explaining how a PyDictObject and its PyDictKeysObject are allocated, how method groups map to Python magic methods, and the detailed C logic for inserting, updating, and retrieving key‑value pairs, including __missing__ handling.
This article explains Java's HashMap implementation, covering its bucket array, linked‑list and red‑black tree handling, hash function perturbation, dynamic resizing, and thread‑safety considerations, providing code examples and diagrams for clear understanding.
This article provides a comprehensive overview of Java's ConcurrentHashMap, explaining its purpose, underlying lock‑segmentation and CAS mechanisms in JDK 7 and JDK 8, demonstrating usage with sample code, and outlining scenarios where it delivers high‑performance thread‑safe map operations.
This article dissects Python's dictionary implementation, explaining the PyDictObject layout, the combined and split hash‑table designs, memory‑optimisation techniques, insertion and lookup processes, ordered iteration, and precise memory‑size calculations with concrete code examples.
This article explains the importance of caching, compares common replacement policies, and walks through a complete Go implementation of a thread‑safe local LRU cache, including interface design, data structures, linked‑list management, and concurrency handling.
This guide explains the difference between Python's shallow and deep copy mechanisms, shows the built‑in tools available, and provides ten concrete code examples covering lists, dictionaries, custom objects, tuples, sets and multi‑level nesting to help you choose the right copying strategy for reliable API test automation.
The article explains how Python's dict uses a hash table to provide constant‑time insertion, deletion, and lookup, demonstrates its speed advantage over lists with benchmarks, and details the handling of collisions, resizing, and the underlying array‑based implementation.
This article explains Python tuples as immutable list subsets, details their C‑level struct layout, creation and deallocation processes, the internal freelist cache for lengths up to 20, performance advantages over lists, and the special handling of the empty tuple singleton.
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.
Redis, an open-source in-memory NoSQL database, is explored in depth covering its high-performance features, typical use cases, evolution, architecture, data types and commands, followed by an overview of Tencent Cloud Redis services and a brief advertisement for a DevOps certification program.
Redis is a high‑performance, in‑memory NoSQL key‑value store offering persistence, rich data types, advanced structures, and robust commands, supporting caching, session storage, pub/sub, and leaderboards, while evolving through replication, Sentinel, clustering, and multithreaded proxies, with Tencent Cloud providing scalable, highly available managed Redis services.
This guide explains the differences between Python's list.sort method and the sorted function, covering their syntax, parameters, performance nuances, and practical examples such as ascending/descending order, custom key functions, and creating sorted copies without altering the original list.
This guide walks backend developers through twenty real‑world Redis use cases—from basic caching, lotteries, and like/collect features to ranking, PV/UV counting, Bloom filters, sign‑in, geo‑search, rate limiting, ID generation, distributed locks, messaging, session sharing, and more—providing Spring Boot code samples, limitations, and best‑practice advice.
This tutorial provides a thorough overview of Python dictionaries, covering their creation, key‑value access, addition, update, deletion, iteration, comprehensions, safe retrieval with get(), merging, sorting, built‑in functions, and unpacking for function arguments, all illustrated with clear code examples.
The article presents a suite of interview‑style algorithm and system‑design solutions—including Bloom‑filter URL blacklists, hash‑partitioned word frequencies, missing‑number bit arrays, top‑K min‑heap, low‑memory median, short‑URL encoding, Redis user counting, and extensive Java implementations of sorting, singleton, LRU cache, custom thread pools, producer‑consumer models and various FooBar synchronization techniques.
This article delves into Rust’s Vec type, explaining its internal structure—including pointer, length, and capacity—detailing essential methods such as push, pop, len, capacity, and iter, and provides practical code examples that illustrate creation, manipulation, iteration, and performance considerations.
Explore Rust arrays in depth—from declaration syntax and element access to iteration, mutable updates, built‑in methods, multidimensional structures, and a practical fixed‑size stack implementation—highlighting their performance‑focused design and safety guarantees for system programming.
This article explores why Redis delivers ultra‑high performance by examining its in‑memory design, single‑threaded event loop, efficient data structures such as hash tables, SDS strings, ziplist, quicklist, and skiplist, as well as its encoding strategies and I/O multiplexing model.
This article traces the evolution of tree‑based index structures—from simple binary search trees through AVL and red‑black trees to B‑trees and B+‑trees—explaining their strengths and limitations and why MySQL adopts B+‑trees to minimize disk I/O and boost query performance.
This article explains Go's container/ring package, detailing its Ring type, core methods, performance characteristics, practical code examples, and typical use cases such as schedulers and resource pools for efficient circular data handling.
This article provides an in‑depth exploration of Go’s container/list package, detailing its internal linked‑list structures, core methods, performance characteristics, practical code examples, and ideal use‑cases for scenarios requiring frequent insertions and deletions.
This article explains Redis's memory model—including memory statistics, allocation, internal data structures, object types, and encoding—while showing practical examples for estimating usage, optimizing consumption, and troubleshooting fragmentation in high‑concurrency environments.
Java's Arrays.asList method has three major pitfalls: it cannot directly convert primitive arrays like int[] because of autoboxing limits, it returns a fixed-size list that throws UnsupportedOperationException on modification, and the list shares its backing array so changes to the original array are reflected in the list; using Arrays.stream for boxing or wrapping the result in a new ArrayList avoids these issues.
MySQL, born in the 1990s as a free open‑source database, became a core component of the LAMP stack and remains widely used; the article explains why indexes are needed, compares binary trees, B‑trees and B+‑trees, and describes how modern cloud‑based MySQL services improve performance and reliability.
This article introduces Go's groundbreaking generics feature introduced in version 1.18, explains its syntax and type constraints, demonstrates practical implementations such as generic functions, data structures, and methods with full code examples, and evaluates the benefits, challenges, and future prospects of using generics in Go.
This article introduces the concept, characteristics, and core operations of singly linked lists, then provides a complete Go implementation with node definitions, insertion at head and tail, deletion, traversal, and a test program to demonstrate usage.
The article explains why Redis stores a single logical collection using two underlying data structures—intset and hashtable for sets, skiplist and ziplist for sorted sets—detailing the encoding rules, upgrade process, example commands, and how this dual‑storage balances O(1) lookups with ordered range queries without duplicating data.
This article introduces a curated collection of Python algorithm implementations, covering basic sorting and searching techniques, as well as advanced methods like quickselect and tabu search, as well as cryptographic algorithms such as Caesar, Vigenère, and RSA, with explanations, visualizations, and links to the GitHub repository for further study.
This article summarizes a Didi second‑round interview covering Redis persistence mechanisms, data structures, memory overflow and leak concepts, thread safety, process vs thread differences, deadlock prevention, TCP/UDP distinctions, and a couple of hand‑written algorithm problems, providing detailed explanations and code examples.
This article compiles a comprehensive set of Python algorithm templates—including syntax shortcuts, knapsack solutions, backtracking, union‑find, topological sorting, monotonic stacks, binary search, dynamic programming, prefix sums, two‑pointer techniques, tree traversals, and graph algorithms—providing clear code snippets and explanations to help developers ace LeetCode interview problems.
This article provides a thorough overview of essential Python concepts, covering numeric operations, string manipulation, function definitions, data structures, class and object usage, as well as useful built‑in tools and utilities, illustrated with clear code examples for each topic.
This article provides a comprehensive overview of B‑tree, B+‑tree, B*‑tree and R‑tree data structures, explaining their definitions, node layouts, height analysis, insertion and deletion algorithms with examples, and their roles in external‑memory indexing for databases and file systems.
Redis is widely known as a high‑performance cache, but its rich data structures, persistence options, and distributed features enable it to serve as a primary storage engine for many internet services, from user profiles and leaderboards to rate limiting, messaging, and geo‑location, while presenting scalability and reliability challenges.
This article explains how Python's mutable list and dictionary types and immutable tuple type can be employed to organize test data, build request payloads, and parse JSON responses when automating API tests, providing clear code examples for each use case.
This article explains the LeetCode LRU Cache problem, detailing the required class interface, operational constraints, and provides a thorough Java solution using a HashMap combined with a doubly linked list to achieve O(1) time complexity for get and put operations.
An extensive Python tutorial covering numeric operations, string handling, built‑in functions, data structures, class and object concepts, as well as useful tools such as iterators, file I/O, serialization, and common utilities, illustrated with clear code examples.
This tutorial explains how to combine Redis and PHP to store and query data efficiently, covering strings, hashes, lists, sets, and sorted sets with clear code examples for each data structure.
This article presents practical Python performance optimization techniques, covering fundamental principles such as avoiding premature optimization, weighing trade‑offs, eliminating global variables, reducing attribute access, minimizing unnecessary abstractions, avoiding data copies, leveraging efficient loops, using short‑circuit logic, applying numba JIT, and selecting appropriate data structures to significantly speed up code execution.
This article explains the concept of shallow copy in Python, contrasts it with deep copy, outlines ten practical scenarios such as parameter passing, data backup, error recovery, and parallel processing, and provides a comprehensive code example demonstrating how to use the list .copy() method in each case.
This article presents nine powerful C utility code examples—including a circular buffer, custom assertions, bit reversal, fixed‑point arithmetic, endianness conversion, bit masks, timer handling, binary search, and a simple bitset—explaining their purpose and demonstrating how they can improve performance and maintainability in embedded system development.
This article explains the concept of hashing and hash tables, describes their characteristics and common collision‑resolution strategies such as open addressing, linear and quadratic probing, chaining, and rehashing, and provides complete Python implementations including a simple hash class, a dynamic map class, and a custom dictionary.
This article explains the concept of AVL self‑balancing binary search trees, outlines their height‑balancing property, and provides step‑by‑step Java code examples defining a Node class implementing Comparable and an AVLTree class with height, balance factor calculations, and rotation methods for insertion and deletion.
This article explains practical Python memory‑saving methods—including inspecting memory usage, using __slots__, generators, memory‑mapped files, choosing efficient data structures, and string interning—providing code examples and performance comparisons to help developers write more memory‑efficient programs.
This article presents a comprehensive collection of 60 frequently used Python built-in functions and techniques, covering numeric operations, string handling, data structures, function definitions, class utilities, and useful tools, each illustrated with clear code examples and explanations for practical programming.
This comprehensive guide walks through Redis's core data structures—including strings, lists, sets, sorted sets, hashes, HyperLogLog, bitmaps, streams, and geospatial indexes—explaining their characteristics and providing concrete command‑line examples to help developers select and use the right structure for their applications.