Some Tips for C/C++ Programming

(Some of these entries only consider usability and do not take optimization into account; use with caution in production environments.)1. C++ Universal Header (*Only usable with the GCC compiler)#include<bits>**Recommended only for competitive programming; otherwise, it may lead to unpredictable issues.2. Improve yourself by practicing on Luogu’s theme library; for exams, use Luogu’s beginner and interview … Read more

Transitioning from C to C++: Basic Concepts

Written on 2025.8.25 Personal Obsidian library, archived to public account. – Universal Header File Standard: #include<iostream> > #include<bits/stdc++.h> >using namespace std; – Input and Output Input cin >> Output cout << – String string (6, ‘A’); #Repeat ‘A’ six times > Access: > for (int i = 0; i < s.size(); i++) > cout << … Read more

Learning Python from Scratch – 09: Dictionaries (dict)

We have learned about the container data types in Python: lists (list) and tuples (tuple). 1. Definition of Dictionary A dictionary is a collection of elements consisting of multiple key-value pairs, enclosed in curly braces { }. Keys and values are connected by a colon : , and elements are separated by commas, .Elements in … Read more

Lists and Tuples in Python

Most programming languages have specific data structures to store sequences of elements indexed by their position: numbered from the first to the last. Previously, we explored Python strings, which are essentially sequences of characters. Next, we will delve into lists. In addition to strings, Python has two other sequence structures: tuples and lists. Both can … Read more

C++ Programming for Kids (22) Binary Trees

C++ Programming for Kids (22) Binary Trees

1. Overview of Trees Trees are a type of <span>non-linear</span> data structure consisting of a <span>set</span> of n (n ≥ 0) finite nodes. This <span>data set</span> effectively describes the branching and hierarchical characteristics of data. Trees in real life Abstract representation of trees Trees in data structures 1. Characteristics of Trees Tree structures are widely … Read more

C Language – Chapter 11: One-Dimensional Array Exercises

C Language - Chapter 11: One-Dimensional Array Exercises

Through exercises on one-dimensional arrays, you can better grasp the definition, initialization, traversal, and common operations of arrays. Below are some exercises on one-dimensional arrays to help you consolidate your knowledge. 1. Exercise: Calculate the Sum of an Array Write a program that inputs 5 integers, stores them in a one-dimensional array, and then calculates … Read more

120 Dictionary Operations in Python

120 Dictionary Operations in Python

Dictionary is one of the most powerful and commonly used data structures in Python. It stores data in the form of key-value pairs, providing fast data lookup capabilities. This article will comprehensively introduce 120 dictionary operation methods, covering basic operations, advanced techniques, and practical application scenarios to help master this important data structure. Previous Python … Read more