Author: admin

  • Web browser: Local Storage

    Local Storage Local storage is a concept in web development that allows websites to store data as key-value pairs in the browser with no expiration time. This feature can retain data even after the browser is closed and reopened, making it useful for storing information that needs to persist across…

  • Web browser: Chrome Storage Item

    Chrome Storage Item Local Storage and Session Storage are suitable for simpler key-value pairs but differ in persistence. IndexedDB is ideal for large, complex datasets and is designed to work asynchronously for better performance. Cookies are small, automatically sent with HTTP requests, and used for session management but have limited…

  • LeetCode: 3 Longest Substring Without Repeating Characters

    Given a string s, find the length of the longest substring without repeating characters. Example: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example: Input: s = "bbbbb" Output: 1 Explanation: The answer is "b", with the length of 1. 问题 给定一个字符串…

  • Git 101: Git Command Cheat Sheet

    Here’s a comprehensive table of Git commands based on the above contents, including explanations and code examples: Git Command Cheat Sheet Command Description in English Description in Chinese Code Example git init Initializes a new Git repository in the current directory 在当前目录中初始化一个新的Git仓库 git init git status Shows the status of…

  • Algorithms 101: Circular Queue Implementation Using Array

    环形队列用数组实现 Circular Queue Implementation Using Array A circular queue is a more efficient implementation of a queue using an array, where the end of the array wraps around to the beginning. This avoids the need to shift elements and allows the queue to efficiently utilize space. Unlike a traditional linear…

  • Algorithms 101: Stack Implementation Using Array

    栈的数组实现 Stack Implementation Using Array A stack can be implemented using an array where the push operation adds an element to the end of the array (top of the stack), and the pop operation removes the element from the end. This implementation is simple and leverages the dynamic resizing capabilities…

  • Algorithms 101: Queue Implementation Using Linked List and Array

    队列的链表实现和数组实现 Queue Implementation Using Linked List and Array 1. 使用链表实现队列 1. Queue Implementation Using Linked List A queue can be implemented using a linked list where each node represents an element in the queue. The head of the linked list represents the front of the queue, and the tail represents…

  • Algorithms 101: What is a Stack

    栈是什么?What is a Stack? A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. This means that the last element added to the stack will be the first one to be removed. Stacks are used in various applications, including expression evaluation, backtracking algorithms, and the undo mechanism…

  • Algorithms 101: What is a Queue

    什么是队列? A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle. This means that the first element added to the queue will be the first one to be removed. Queues are widely used in scenarios where tasks need to be processed in the order they arrive, such…

  • Leetcode: 86 Partition List

    Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. Example: Input: head = [1,4,3,2,5,2],…