Underlying principle of C++ string
1, Deep and shallow copy Shallow copy:
When implementing a string, if you do not copy the string first, a copy constructor will be automatically generated, but it is only a shallow copy. Two string objects point to the same address. When two objects call the destructor, the destructor called by the previous object has released the internal sla ...
Posted by magicmoose on Wed, 17 Nov 2021 08:28:58 -0800
Detailed explanation of linked list (single linked list, circular linked list, two-way linked list, Linux kernel "shared" double linked list) C/C++
The complete code of single linked list, circular linked list, two-way linked list and Linux kernel "shared" double linked list is attached at the end of the article
catalogue
1, Detailed explanation of linked list principle
2, Implementation of single linked list algorithm
2.1 concept of single linked list
2.2 single link ...
Posted by jbradley04 on Tue, 16 Nov 2021 20:49:42 -0800
Java linked list data structure brush notes summary
Java linked list data structure brush notes summary
This article has referred to the labuladong algorithm, and has compiled some notes and thoughts. You can pay attention to his official account. I'm a vegetable 555. I've just started to brush questions. I'll take notes here. Hey hey~
Characteristics of linked list
Types of linked lists ...
Posted by rn14 on Fri, 12 Nov 2021 07:39:22 -0800
leetcode circular linked list I & II
1. Circular linked list I
1.1 Title Description
The link to this question comes from leetcode
Example
Advanced and tips:
1.1.1 interface function
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
bool hasCycle(struct ListNode *head) {
}
1.2 general fra ...
Posted by ccgorman on Thu, 11 Nov 2021 15:15:50 -0800
LeetCode brush notes linked list traversal linked list
160 intersecting linked list
Given two linked lists, judge whether they intersect at a point, and find the intersection node.
The input is two linked lists and the output is one node. If there are no intersecting nodes, an empty node is returned.
Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3 Out ...
Posted by suvarthi on Wed, 10 Nov 2021 19:12:06 -0800
Introduction to algorithm C-206. Reverse linked list
LeetCode problem brushing - algorithm learning plan (Introduction)
Title Description
Introduction of ideas
If the linked list is bidirectional, reversing the linked list is very simple. You only need to exchange the forward pointer and backward pointer. But now the topic specifies a single linked list, how to reverse it? In fact ...
Posted by lordshoa on Wed, 10 Nov 2021 09:14:53 -0800
Judge whether it is a balanced binary tree - js
01 - sum of two numbers - js
describe Given an integer array numbers and a target value target, please find two subscripts in the array that add up to the target value, and the returned subscripts are arranged in ascending order.
Example 1
Input:[3,2,4],6
Return value:[2,3]
Note: because 2+4=6 ,And the subscript of 2 is 2, and the subscrip ...
Posted by sherri on Wed, 10 Nov 2021 08:05:06 -0800
Linear data structure linked list, linked list stack, linked list queue, bidirectional linked list, circular linked list and Joseph Ring problem solving
preface
This chapter describes in detail the use and related operations of linked list, a linear data structure. In fact, many people can't understand the link between the nodes and the link before the nodes. It will be very difficult to learn, because I was like this at the beginning. I figured it out later. In fact, it is the following idea: ...
Posted by dunnsearch on Sat, 06 Nov 2021 01:34:53 -0700
[ye shisan] summary of the most complete knowledge of data structure and algorithm
Brain map: https://www.processon.com/mindmap/6179408f0e3e7416bdeb81d1
development environment
Mac C locale configuration
Software: Visual Studio Code
Coder Runner plug-in
1, Overview of data structures
1. Definition
How do we save a large number of complex problems in reality to the main memory (memory) with specific data type ...
Posted by High_-_Tek on Fri, 05 Nov 2021 22:34:06 -0700
[Java] understanding and implementation through Java -- sequence table and single chain table
🍉 Linear table
A linear list is a finite sequence of n data elements with the same characteristics. Linear table is a data structure widely used in practice. Common linear tables: sequential table, linked list, stack, queue, string A linear table is logically a linear structure, that is, a continuous straight line. However, the physi ...
Posted by gljaber on Fri, 05 Nov 2021 19:57:54 -0700