Results for “Small algorithms & bit operations”
Small, practical examples. Search by task or narrow things down below.
Write and read bytes without text conversion
C++: Use binary stream modes and check each I/O operation before consuming its result.
C++✓ Tested
Write and read raw bytes
C#: Use the byte-oriented file APIs when no text encoding should be applied.
C#✓ Tested
Add and remove values at both ends
C++: Deque supports efficient end operations without requiring contiguous storage.
C++✓ Tested
Announce a status update politely
Announce a status update politely with a small React component and explicit browser behavior.
React✓ Tested
Append to an array without mutating state
Append to an array without mutating state with a small React component and explicit browser behavior.
React✓ Tested
Assign a CSS class in JSX
Assign a CSS class in JSX with a small React component and explicit browser behavior.
React✓ Tested
Attach containers to a user-defined network
Create a dedicated network for a small group of containers.
network✓ Tested
Average a fixed set of readings
Accumulate sample values without overflowing a 16-bit total.
array✓ Tested
Calculate a value inside JSX
Calculate a value inside JSX with a small React component and explicit browser behavior.
React✓ Tested
Calculate a value with SELECT
SQL: Evaluate a small arithmetic expression on the database server.
SQL✓ Tested
Calculate a value with SELECT
SQL Server: Evaluate a small arithmetic expression on the database server.
SQL Server✓ Tested
Calculate a value with SELECT
Postgres: Evaluate a small arithmetic expression on the database server.
Postgres✓ Tested