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