Deep understanding of pointers
Deep understanding of pointers
preface
First, let's understand the concept of the following pointers:
A pointer is a variable used to store an address, which identifies a piece of memory space.The size of the pointer is fixed at 4 or 8 bytes (32 or 64 bits).Pointers are typed, which determines the step size of pointer operation and t ...
Added by MrBillybob on Tue, 18 Jan 2022 08:36:53 +0200
Implementation principle of HashMap
1, Overview
HashMap
The general structure of the hash table is shown in the figure below. The hash table is an array. We often call each node in the array a bucket, and each node in the hash table is used to store a key value pair. When inserting elements, if there is a conflict (that is, multiple key value pairs are mapped to the same buc ...
Added by sunilj20 on Tue, 18 Jan 2022 08:17:06 +0200
[daily force deduction 24] merge two ordered linked lists
1, Title [LeetCode-21]
Merge the two ascending linked lists into a new} ascending linked list and return. The new linked list is composed of all nodes of a given two linked lists.
Example 1:
Input: l1 = [1,2,4], l2 = [1,3,4]
Output: [1,1,2,3,4,4]
Example 2:
Input: l1 = [], l2 = []
Output: []
Example 3:
Input: l ...
Added by sushiX on Tue, 18 Jan 2022 02:44:20 +0200
The worst case is the linear time selection algorithm
The worst case is the linear time selection algorithm
Reference: [algorithm] Introduction to algorithm: https://www.bilibili.com/video/BV1Tb411M7FA?p=6
Ask questions: find the K-th largest number from an array, that is, the TOPK problem. This problem is often encountered in interviews and research. Then, how should this problem be solved?
Of ...
Added by ChessclubFriend on Tue, 18 Jan 2022 01:00:08 +0200
[data structure] storage structure and basic operation of stack (sequential stack, double ended stack, chain stack) (C language)
1. Basic concept of stack
Stack is a restrictive linear table, which limits the insertion and deletion of linear tables to only one end of the table. Generally, the end of the table that allows insertion and deletion is called the Top of the stack. Therefore, the current position of the Top of the stack changes dynamically, which is indica ...
Added by Cosizzle on Mon, 17 Jan 2022 23:57:14 +0200
5 questions to teach you how to solve the sliding window
preface
The so-called window is a continuous closed set, which is generally represented by left and right pointers, but it will also change according to the meaning of the question, such as the following question
187. Repetitive DNA sequences
All DNA consists of A series of nucleotides abbreviated as' A ',' C ',' G 'and'T', such as " ...
Added by [-_-] on Mon, 17 Jan 2022 23:53:27 +0200
Source code analysis of PriorityQueue
catalogue
Member variable
Constructor
add to
Return queue header element / out of queue operation
delete
Analysis of bottom binary heap algorithm
summary
Talk about the heap sorting algorithm
Member variable
public class PriorityQueue<E> extends AbstractQueue<E>
implements java.io.Serializable {
private static fi ...
Added by kimbhoot on Mon, 17 Jan 2022 22:49:59 +0200
leetcode question brushing / hash table 438 Find all alphabetic words in the string
438. Find all letter words in the string
Meaning:
Given two strings S and p, find the substrings of all ectopic words of p in s, and return the starting indexes of these substrings. The order in which answers are output is not considered.
Ectopic words refer to strings with the same letters but arranged differently.
Example 1:
input: ...
Added by landonmkelsey on Mon, 17 Jan 2022 21:24:11 +0200
Linear list - sequential list, one-way linked list and two-way linked list
Blog home page (4 messages) Xiao Wu_ Xiao Wu has an idea_ CSDN blog - notes, java,leetcode domain bloggersWelcome to pay attentiongive the thumbs-upCollection and messageHeaven rewards diligence. Diligence can make up for weakness. Come on with Xiao Wu17-year-old freshman, limited level, please give advice, thank you very much! Refer to t ...
Added by hellrising on Mon, 17 Jan 2022 20:38:30 +0200
7-1 symmetrical sorting (25 points)
7-1 symmetrical sorting (25 points)
The title comes from PTA
You work for the albatross circus with a group of ugly stars as pillars. You have just completed a program that outputs their list in non descending order according to the length of the stars' name string (that is, the length of the current name is at least the same as that of th ...
Added by Eclesiastes on Mon, 17 Jan 2022 10:23:11 +0200