Day94: divide and conquer strategy of sorting algorithm

Day93: loop invariants of sorting algorithm < insert, select, bubble > Divide and conquer strategy Divide And Conquer: resolve a big problem into countless same small problems for solution, that is, the use of recursion. Sorted divide and conquer strategy: Continuously split set A into the same small set, and finally return to the soluti ...

Posted by mdgottlieb on Sun, 31 Oct 2021 07:36:48 -0700

java implementation of binary search tree and its related operations

java implementation of binary search tree and its related operations The basic operations of Binary Search Tree include search, maximum, minimum, precursor, successor, insertion and deletion. The time spent on the basic operation of the binary search tree is proportional to the height of the tree. For example, for a complete binary tree with ...

Posted by alwaysme on Sun, 31 Oct 2021 05:13:56 -0700

Structure, enumeration, union

structural morphology Why does struct exist? Computer is to solve people's problems. People know the natural world through "attributes". The attribute set abstracted from anything can be used to represent a class of things and types. In this work, c, struct. Declaration of structure type struct tag { member_list; }variable_list; ...

Posted by LostKID on Sat, 30 Oct 2021 16:52:46 -0700

Classic interview questions of binary tree (you deserve it)

Classic interview questions of binary tree Before that, I have published the basic knowledge of binary tree: Detailed explanation of binary tree Next, I will tell you some classic and common binary tree interview questions Preliminary interview questions Maximum depth of binary tree Question: Maximum depth of binary tree Solution idea: ...

Posted by gacon on Sat, 30 Oct 2021 12:46:33 -0700

Knowledge summary and code implementation of sequence team

catalogue Storage mode of sequential queue Characteristics of sequential queue storage Definition of empty and full teams Methods to solve false overflow Sequential queue function Code implementation of acyclic sequential queue Cyclic sequential queue Judgment method of solving queue full by cyclic sequential queue Cyclic sequential qu ...

Posted by BryonS on Fri, 29 Oct 2021 23:52:17 -0700

Comparison of objects in java (three ways)

Question raised Last class, we talked about priority queue. When inserting elements into priority queue, there is a requirement: the inserted elements cannot be null or the elements must be able to be compared. For simplicity, we just inserted Integer type. Can we insert custom type objects in priority queue? Let's start with a code: clas ...

Posted by jenniferG on Fri, 29 Oct 2021 21:18:00 -0700

List common operations are more elegant than for loops

introduction After using JDK1.8, most list operations can be written using lamada expressions, which can make the code simpler and develop faster. The following are the common operations of lamada expressions I use in my work on list. I like to collect suggestions. Taking the user table as an example, the user entity code is as follows: public ...

Posted by ali_2kool2002 on Fri, 29 Oct 2021 17:32:13 -0700

Hash table of data structure

1, Basic introduction 1. Basic introduction Hash table (also known as hash table) is a data structure that is accessed directly according to the Key value. In other words, it accesses records by mapping key values to a position in the table to speed up the search. This mapping function is called hash function, and the array storing records is ...

Posted by thenature4u on Thu, 28 Oct 2021 20:36:02 -0700

Learning notes: Chapter 3 stack and queue

Chapter 3 stack and queue Part I stack 1. Definition of stack A stack is a linear table that is restricted to insert and delete operations only at the end of the table. We call the end that allows insertion and deletion as the top of the stack, the other end as the bottom of the stack, and the stack without any data elements as an empty ...

Posted by westexasman on Thu, 28 Oct 2021 13:33:09 -0700

[data structure and algorithm] - linked list

home pagespecial columnjavaArticle details0[data structure and algorithm] - linked listbenntty74 Published 13 minutes ago1. What is a linked listLinked list is a kind of linear list. Linear table means literally that the relationship between data is connected by a line.Linear tables are divided into address space continuous and address space di ...

Posted by stolzyboy on Thu, 28 Oct 2021 12:58:33 -0700