Building a Classic Snake Game with C and Win32 API
Project ObjectivesDevelop a console-based Snake game using C on Windows. The implementation includes:Game map renderingSnake movement controlled by arrow keysFood consumption mechanicsCollision detection (walls and self)Score tracking systemSpeed adjustment (acceleration and deceleration)Pause functionalityEssential TechnologiesThis project uti ...
Posted on Sun, 06 Sep 2026 16:55:59 +0000 by dayang
Implementing a Doubly Linked List with Sentinel Node in C
Understanding Doubly Linked Lists Doubly linked lists are a fundamental data structure where each node contains a pointer to both the next and previous nodes in the sequence. This bidirectional nature allows for efficient traversal in both directions, unlike singly linked lists which can only be traversed forward.
In this implementation, we'll ...
Posted on Thu, 27 Aug 2026 16:04:27 +0000 by Neotropic
Array and Linked List Fundamentals for Coding Interviews
Time Complexity Basics
Common time complexities sorted from fastest to slowest:
O(1) < O(log n) < O(n) < O(n log n) < O(n²) < O(n³) < O(2ⁿ) < O(n!) < O(nⁿ)
LeetCode Training
Chinese site: https://leetcode-cn.com/problemset/all/
English site: https://leetcode.com/
Arrays
Time Complexity
Arrays occupy contiguous memory blo ...
Posted on Fri, 24 Jul 2026 16:11:34 +0000 by TheLoveableMonty
Implementing Linked Lists in C
Linked List Types
Singly Linked List
Doubly Linked List
Circular Linked List
Node Insertion
Node Deletion
Code Implemantation
1. Node and List Structure
typedef struct ListNode {
int value;
struct ListNode* next;
} ListNode;
typedef struct LinkedList {
ListNode* first;
size_t count;
} LinkedList;
2. List Initialization
void ...
Posted on Sat, 11 Jul 2026 17:00:33 +0000 by weknowtheworld
Understanding and Implementing Singly Linked Lists in C
Introduction to Singly Linked Lists
A singly linked list is a fundamental data structure consisting of nodes where each node contains data and a pointer to the next node in the sequence. Unlike arrays, linked lists don't require contiguous memory allocation, making them flexible for dynamic data storage.
The structure resembles a train where ea ...
Posted on Sun, 05 Jul 2026 16:22:48 +0000 by Cogen2
Queue Implementation in C Using Linked Lists
Queue Implementation in C Using Linked Lists
A queue is a fundamental data structure that follows the First-In-First-Out (FIFO) principle. This article presents a complete implementation of a queue using linked lists in C.
Header File - Queue.h
The header file contains function declarations and structure definitions for our queue implementat ...
Posted on Wed, 20 May 2026 05:05:19 +0000 by ziggs
Algorithmic Strategies for Sequence Construction, Pattern Matching, and Tree-Based Scheduling
Problem A: Reachable Sums via Step Sizes
Tags: Dynamic Programming Knapsack Variation
Approach
Given a maximum limit n and two step values a and b, the objective is to determine the largest integer less than or equal to n that can be formed by summing multiples of a and b. Since the value range is constrained, a boolean dynamic programming arra ...
Posted on Sun, 10 May 2026 11:38:23 +0000 by adrian_melange
Data Structures: A Comprehensive Technical Overview
For Loops
The for loop syntax in C mirrors that of JavaScript:
for (initialization; condition; increment/decrement) {
// loop body
}
Arrays
Time Complexity
Operation
Average Case
Worst Case
Acess
O(1)
O(1)
Search
O(n)
O(n)
Insert
O(n)
O(n)
Delete
O(n)
O(n)
Multidimensional Arrays
C++ stores multidimensional arrays as a cont ...
Posted on Sun, 10 May 2026 02:12:24 +0000 by slick101
Linked List Problems: Swapping, Removal, Intersection, and Cycle Detection
Swapping Nodes in Pairs
Problem: Given a linked list, swap every two adjacent nodes and return its head.
Iterative Approach:
class ListNode {
int val;
ListNode next;
ListNode(int val) { this.val = val; }
}
class Solution {
public ListNode swapPairs(ListNode head) {
if (head == null || head.next == null) {
...
Posted on Sat, 09 May 2026 04:52:05 +0000 by psurrena