C language file operation details

preface In C language, file is an important concept in programming. The operating system manages data in the unit of files. Although there may not be many places to use files in the future, files are still an indispensable part of C language. Well, no more nonsense. Let's get straight to the point. 1, What is a file Concept: files on dis ...

Posted by Tjeuten on Sat, 27 Nov 2021 21:25:53 -0800

LeetCode sword finger Offer II linked list (021-029)

021. Delete the penultimate node of the linked list Title: Given a linked list, delete the penultimate node of the linked list, and return the head node of the linked list. Example: Input: head = [1,2,3,4,5], n = 2 Output: [1,2,3,5] Idea: Fast and slow pointers: the slow pointer is the head node, the difference between the f ...

Posted by golfromeo on Sat, 27 Nov 2021 21:14:57 -0800

Statistical leaf node 21

1, Title Description Description The preorder traversal and inorder traversal of a binary tree are given, and the number of leaf nodes of the corresponding binary tree is counted. This question requires the use of a binary linked list, otherwise even if it passes, points will be deducted as appropriate. Input Input two lines of string compo ...

Posted by freelancedeve on Sat, 27 Nov 2021 18:56:45 -0800

[data structure] recursive implementation of quick sorting_ Detailed explanation of three methods + optimization

There are eight common sorting algorithms, so it is estimated that they will be divided into several periods. Interested friends may wish to click a collection column. ღ (´ᴗᴗღ) comparison Center OJ link Quick sort is an exchange sort method with binary tree structure proposed by Hoare in 1962. Its basic idea is: Any element in t ...

Posted by Brad on Sat, 27 Nov 2021 17:21:23 -0800

20211127_datawhale31_ leetcode brush title_ 4 Double pointer and sliding window

Four Array Double Pointer and Slide List Images Source: https://realpython.com/ source Datewhale31_u LeetCode Title: Route pioneer: Yang Shichao Navigator: Liu Jun Sailors: Yang Shichao, Li Yanpeng, Ye Zhixiong, Zhao Zi Open Source Content https://github.com/itcharge/LeetCode-Py Open source e-books https://algo.itcharge.cn 1 Arra ...

Posted by natepizzle on Sat, 27 Nov 2021 09:34:40 -0800

LeetCode-130 - surrounded area

Surrounded areaTitle Description: give you a matrix board of m x n, which consists of several characters' X 'and' O ', find all areas surrounded by' X ', and fill all' O 'in these areas with' X '.See LeetCode's official website for an example.Source: LeetCode Link: https://leetcode-cn.com/probl... The copyright belongs to Lingkou network. For ...

Posted by fireMind on Fri, 26 Nov 2021 20:00:14 -0800

Detailed explanation of C language sorting algorithm 1 (bubbling, selection, insertion, merging, fast)

Article catalog         1. Bubble sorting         2. Select Sorting         3. Insert sort         4. Merge and sort         5. Quick sort   1, Bubble sorting Basic idea: In a group of numbers to be sorted, compare and adjust t ...

Posted by parena on Fri, 26 Nov 2021 18:28:22 -0800

Request page storage management basic replacement algorithm LRU and CLOCK

1, Experimental purpose By simulating several basic page replacement algorithms for request page storage management, understand the characteristics of virtual storage technology, master the basic ideas and implementation process of several basic page replacement algorithms in virtual storage request page storage management, and compare their e ...

Posted by fortnox007 on Fri, 26 Nov 2021 16:03:13 -0800

[LeetCode learning plan] algorithm introduction C + + day 7 breadth first search / depth first search

733. Image rendering LeetCode simple single \color{#00AF9B} {simple} simple There is a picture represented by a two-dimensional integer array. Each integer represents the pixel valu ...

Posted by Boo-urns on Fri, 26 Nov 2021 04:24:07 -0800

257. All paths of binary tree

Here's the code you can't write clearly! It's a concept called backtracking. Because the parameters here are written in the way of passing reference, if you change one branch line, the other will also change. When you stack again, you will add more NIMA. In addition, it's not good to set the recursive base to an empty node here, because every ...

Posted by kiltannen on Thu, 25 Nov 2021 14:49:22 -0800