String Hashing Techniques and Applications
Properties of String Hashing
Different hash values guarantee different strings.
Identical hash values don't guarantee identical strings (though probability is high).
Modulus Selection
Prime moduli are preferable based on number theory. For example, (ax + b) mod p distributes with interval gcd(a, p). The modulus must prevent overflow in 64-bi ...
Posted on Wed, 29 Jul 2026 16:20:42 +0000 by lalabored
Implementing a Doubly Circular Linked List in C
A doubly circular linked list supports core operations such as initialization, destruction, emptiness checking, traversal, insertion, deletion, search, and modification. Insertion and deletion can further be categorized into head/tail vraiants.
This implementation is organized across three files:
List.h: Declares the node structure and functio ...
Posted on Sat, 25 Jul 2026 17:02:53 +0000 by Basdub
Essential C Programming Concepts and Common Pitfalls
C Language Key Concepts and Frequent Errors
1. Integer Literal Representations
Fundamentals: On most modern systems, an int occupies 4 bytes (32 bits). The Most Significant Bit (MSB) serves as the sign bit, where 0 indicates a positive value and 1 indicates a negative value.
Base Conversion: To convert a decimal number to binary, repeatedly di ...
Posted on Sat, 25 Jul 2026 16:21:46 +0000 by Garcia
Implementing Stack Data Structures in Java
A stack is a linear data structure that restricts insertion and deletion operations to one end—commonly referred to as the top. This constraint enforces a Last-In-First-Out (LIFO) behavior: the most recently added element is the first to be removed.
Core Terminology
Top: The active end where all push and pop operations occur.
Bottom: The fixed ...
Posted on Fri, 24 Jul 2026 16:29:29 +0000 by elhelaly1999
Understanding C# Arrays: One-Dimensional and Rectangular Arrays
Array Definition
An array is a data structure that contains a fixed number of elements of the same type. Each individual item within an array is called an element. The number of dimensions an array has is known as its rank. The size of each dimension is its length, and the total number of elements across all dimensions is the array's length. ...
Posted on Thu, 23 Jul 2026 17:00:52 +0000 by Hodo
Linked List Operations and Array-Based Implementations
Header File Inclusion
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
Data Type Defniition
Using a type alias improves maintainability and simplifies type changes across the codebase:
typedef int ElementDataType;
Node Structure Definition
typedef struct ListNode {
ElementDataType value;
stru ...
Posted on Tue, 21 Jul 2026 16:18:22 +0000 by iskawt
Fundamental Algorithmic Patterns and Code Templates for Competitive Programming
Binary Search Methodologies
Integer binary search typically relies on partitioning a range [left, right] based on a predicate function. Two common partitions are used depending on whether the midpoint belongs to the left or right sub-interval.
// Partition: [left, pivot] | [pivot + 1, right]
int find_first_valid(int left, int right) {
while ...
Posted on Sat, 18 Jul 2026 16:57:35 +0000 by kmutz22
Implementing a Priority Heap in Java
This article focuses on implementing a min-heap, which has the property that every parent node is less than or equal to its children. This ensures the smallest element is always at the root (index 1 in our array).
Heap Operations
A min-heap implementation should support these basic operations:
Insertion (I): Add a new element to the heap while ...
Posted on Fri, 17 Jul 2026 16:48:25 +0000 by Gonwee
AtCoder Beginner Contest 352 Solutions
Problem A - AtCoder Line Straightforward check: determine whether point z lies between x and y on the number line. Simply swap if necessary to ansure x ≤ y, then verify the condition. Click to view code
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int n, p, q, r;
scanf("%d%d%d%d", & ...
Posted on Thu, 16 Jul 2026 17:03:34 +0000 by craigbabe
Redis Internal Storage Architecture and Data Structures
Redis Storage Structure
Value Encoding Types
Redis automatically selects the most efficient encoding format based on the characteristics of stored data:
String
int: String length ≤ 20 and convertible to integer
raw: String length > 44
embstr: String length ≤ 44
List
quicklist: Optimized linked list structure
ziplist: Compressed list for ...
Posted on Thu, 16 Jul 2026 16:59:55 +0000 by jeff2007XP