Introduction to tree structure of java data structure

1. Tree structure Is an abstract data type or a data structure that implements this abstract data type, which is used to simulate a data set with tree structure. It has the following characteristics: ①Each node has zero or more child nodes; ②A node without a parent node is called a root node; ③Each non root node has only one parent node; ...

Posted by ashishag67 on Tue, 21 Sep 2021 21:22:38 +0200

Force Button Exercise 1 (Ten Questions)

1. Given an integer array nums and an integer scalar target, find the two integers in the array that are the target and return their array subscripts. You can assume that each input corresponds to only one answer. However, the same element in the array cannot be repeated in the answer. You can return the answers in any order. Example 1: ...

Posted by emopoops on Tue, 21 Sep 2021 02:54:11 +0200

Deeply understand the underlying data structure of Redis List queue

Deeply understand the underlying data structure of Redis List queue CentOS 7 installs redis6.25 in combination with the docker image configuration method (redis.conf file is attached) list underlying data structure: linkedList linked list Zip list zip list quickList Linked list: LinkedList The two-way linked list of the leading nod ...

Posted by petersro on Mon, 20 Sep 2021 12:32:35 +0200

leetcode writing diary

1. Where the dream begins - the sum of two numbers Given an integer array nums and an integer target value target, please find the two integers with and as the target value target in the array and return their array subscripts. You can assume that each input will correspond to only one answer. However, the same element in the array cannot be r ...

Posted by umguy on Mon, 20 Sep 2021 08:56:59 +0200

C language data structure - single linked list

Concept of linked list Concept: linked list is a non continuous and non sequential storage structure in physical storage structure. The logical order of data elements is realized through the pointer link order in the linked list. Let's start the single linked list Create a structure first typedef int SLTDateType; typedef struct SListNode ...

Posted by jgetner on Mon, 20 Sep 2021 08:18:05 +0200

Data Structure - Sorting

1) Insert Direct insertion sort thinking When inserting the first i(i>=1) element, the preceding array[0],array[1],..., array[i-1] is already sorted, and the sort order of array[i] is compared with that of array[i-1],array[i-2],.... The insertion position is to insert array[i], the order of elements on the original position is moved ...

Posted by Mundo on Sun, 19 Sep 2021 22:07:32 +0200

STL learning notes string

STL learning notes (I) string c_str() const char *c_str(); c_ The str() function returns a pointer to the normal C string, with the same content as this string string s="123" printf("%s",s.c_str()) Add: insert() iterator insert( iterator i, const char &ch ); basic_string &insert( size_type index, const basic_string & ...

Posted by derrick24 on Sun, 19 Sep 2021 20:41:52 +0200

leetcode question brushing (array - binary search)

Binary search Binary search Given an n-element ordered (ascending) integer array nums and a target value target, write a function to search the target in nums. If the target value exists, return the subscript, otherwise return - 1. Example 1: Input: num = [- 1,0,3,5,9,12], target = 9, output: 4 Explanation: 9 appears in nums and the sub ...

Posted by EXiT on Sun, 19 Sep 2021 13:36:21 +0200

Data structure -- LeetCode special exercise Day14

43. String multiplication Give two nonnegative integers in string form   num1   and   Num2, return   num1   and   num2   Their products are also expressed in string form. Example 1: Input: num1 = "2", num2 = "3" Output: "6" Example   2: Input: num1 = "123", num ...

Posted by Fearpig on Sun, 19 Sep 2021 09:39:55 +0200

[data structure and algorithm] Chapter 4: Advanced sorting

Basic sorting: bubble sorting, selection sorting and insertion sorting. In the worst case, the time complexity is O(N^2), square order. With the increase of input scale, the time cost will rise sharply, so these basic sorting methods can not deal with larger scale problems 4.1 Hill sorting Hill sort is a kind of insertion sort, al ...

Posted by wwwapu on Sun, 19 Sep 2021 03:50:53 +0200