2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
2024.7.11
**Daily Question**
2972. Count the number of increasing subarrays removed Ⅱ. This question is exactly the same as yesterday's pre-question, except that the data range is larger. We still deal with the largest ascending prefix first and add the answer. Then we start from the last element and traverse until a non-descending element appears. Each time we traverse an element, we find the largest prefix that satisfies the size relationship at the connection, and then add the answer.
160. Intersecting linked lists. This question uses a hash table to store the nodes of the linked list. We first traverse the linked list A, add all the nodes to the hash table, and then traverse the linked list B. If the corresponding value is found in the hash table, then the value is returned, otherwise a null pointer is returned.
206. Reverse a linked list. This question examines the basic properties of a linked list. When reversing, we can think of it as changing the successor node of the current node to the predecessor node, and traversing it once is enough. Each time, we need to record the successor node first, then change the successor to the predecessor, then update the predecessor to the current node, and then move the current node forward. This operation is equivalent to first determining the last node, and then determining the nodes forward one by one.