Author: admin
-
Algorithms 101: Merge Two Sorted Linked Lists
•
合并两个有序链表 Merging two sorted linked lists is a common problem that requires combining two ascending order lists into a new sorted linked list. The resulting linked list should maintain the ascending order and include all the nodes from both input lists. This problem is often encountered in algorithmic challenges and…
-
LeetCode: 162 Find Peak Element
•
A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks. You may imagine that nums[-1] = nums[n] = -∞.…
-
Algorithms 101: Singly and Doubly Linked Lists and Their Reversal – Stack Interpretation
•
单双链表及其反转 – 堆栈诠释 Linked lists are fundamental data structures in computer science, offering a flexible way to store and manipulate data. A singly linked list consists of nodes where each node contains data and a reference to the next node in the sequence. A doubly linked list, on the other…
-
Algorithms 101: Binary Search Doesn’t Have to Occur in a Sorted Array
•
二分搜索不一定发生在有序数组上 In computer science, binary search is an efficient algorithm used to find a specific element in a sorted array. However, binary search is not limited to only sorted arrays. It can also be applied in specific scenarios where the array is not entirely ordered but still has certain properties…
-
Algorithms 101: Directional Search Algorithm for Gomoku
•
In this blog, we will explore the implementation and optimization of a directional search algorithm to determine the win condition in a game like Gomoku (五子棋). Gomoku is a traditional board game where two players take turns placing black or white stones on a grid, with the objective of aligning…
-
Security 101: Understanding and Comparing Two SSO Methods: Session-Based vs. Token-Based Authentication
•
Single Sign-On (SSO) is a critical component in modern web applications, allowing users to log in once and access multiple systems without needing to re-authenticate. This blog post explores two popular SSO methods—Session-Based and Token-Based Authentication—and offers guidance on which one is generally recommended. Session-Based SSO How It Works User…
-
Top 10 Software Development Books
•
General Advice The Pragmatic Programmer A classic book offering timeless advice for software developers, emphasizing practical techniques and a pragmatic approach to coding. 《程序员修炼之道》:一本经典书籍,为软件开发者提供了永不过时的建议,强调实用的技术和务实的编码方法。 Code Complete A comprehensive guide to software construction, covering coding best practices, design strategies, and debugging techniques. 《代码大全》:一本关于软件构建的全面指南,涵盖编码最佳实践、设计策略和调试技巧。 Coding Clean Code This book focuses on writing…
-
Python 101: Understanding the `self` Keyword in Python: A Different Perspective
•
Introduction The self keyword in Python is a cornerstone of object-oriented programming, used to refer to the instance of the class itself. By mastering self, you can create classes that encapsulate data and behaviors in a more organized and efficient manner. Let’s explore self with different examples, tips, comparisons, and…
-
Algorithms 101: Using Bitwise AND to Check the Least Significant Bit
•
The bitwise AND operation is a fundamental tool in low-level programming, and it’s particularly useful when working with binary data. One common use case is to check whether a number is even or odd by examining its least significant bit (LSB). This technique is efficient and commonly used in performance-critical…
-
LeetCode: 371 Sum of Two Integers
•
Given two integers a and b, return the sum of the two integers without using the operators + and -. Example: Input: a = 1, b = 2 Output: 3 Example: Input: a = 2, b = 3 Output: 5 问题 给定两个整数 a 和 b,在不使用 + 和 – 运算符的情况下,返回两个整数的和。 解决方案…