Two way bfs -- dimension reduction attack on the rearrangement of the nine palaces

What is bidirectional bfs? Ordinary bfs traverses downward from one vertex, while bidirectional bfs traverses downward and upward from the two endpoints in turn when the end point is known, until the number of layers overlaps with the previous traversal, the answer comes out. It is clear that a two-way bfs needs to meet a necessary cond ...

Posted by riversr54 on Fri, 18 Feb 2022 12:45:29 +0100

STL container: dual end queue deque and priority queue priority_queue

Double ended queue deque deque is a double ended queue, which can be inserted at the head and tail, or deleted at the head and tail. Its advantage is that it combines the advantages of vector and list, but realizes random access and header plug deletion. When the space is not enough and needs to be expanded, it does not need to be as compl ...

Posted by chadtimothy23 on Fri, 18 Feb 2022 12:12:55 +0100

Data structure - linear structure: Queue ["Queue" corresponds to a subset of array operations;]

2, Queue The operation can only be performed at one end of the list (the operation can be performed at the other end of the list) through the specified order of the list (the operation can be performed at the other end of the list). Queue: a First In First Out linear table, called FIFO for short. The end allowed to be inserted is the ...

Posted by djrichwz on Fri, 18 Feb 2022 10:36:31 +0100

Division of [interval DP] convex polygon

Topic source Click me to enter the ACwing official website to submit Title Description Given a convex polygon with n vertices, label the vertices from 1 to N, and the weight of each vertex is a positive integer. Divide the convex polygon into N − 2 disjoint triangles. For each triangle, the weights of its three vertices can be multipl ...

Posted by jamesjohnson88 on Fri, 18 Feb 2022 10:04:32 +0100

Advanced data structure (Ⅳ) Binary Sort Tree (BST)

Advanced data structure (Ⅳ) Binary Sort Tree (BST) Basic concepts This data structure is composed of nodes. The links contained in nodes can be empty (null) or point to other nodes. In a binary tree, each node can only have one parent node (with one exception, that is, the root node, which has no parent node), and each node has only two l ...

Posted by revdev on Fri, 18 Feb 2022 07:55:57 +0100

[data structure] the order table in Python -- List

College compulsory courses "Data structure and algorithm" is a required course of computer, no matter in which university. I remember that the course was implemented in C language at that time. The first data structure I came into contact with was the sequential table in the linear table, which was implemented by array. The structure ...

Posted by hothientuan on Fri, 18 Feb 2022 07:38:54 +0100

Data structure - Chapter 3 linked list

List 1. Introduction 1.1. Abstract Data Types(ADTS) ADT definition: a set of objects together with a set of operations Abstract data types are mathematical abstractions; nowhere in an ADT‟s definition is there any mention of how the set of operations is implemented. A set of objects and a set of operations. Abstract data types are mathemat ...

Posted by ryanh_106 on Fri, 18 Feb 2022 07:31:24 +0100

Hash table (hash table) summary (C language)

Basic concepts in hash table Hash table definition: Hash table (also known as hash table) is a data structure that performs insertion, deletion and lookup in constant time. It is a data structure that is accessed directly according to the key value. That is, it accesses records by mapping key values to a location in the table to speed up t ...

Posted by beedie on Fri, 18 Feb 2022 06:55:53 +0100

Time complexity

catalogue 1, Concept definition 2, Symbolic representation 3, Common species 4, Parsing example 1, Concept definition According to the definition, time complexity refers to the time required for the algorithm to run when the input data size is N +. Note: It counts the "number of calculation operations" of the algorithm, no ...

Posted by hamza on Thu, 17 Feb 2022 22:55:04 +0100

Three questions: understand hash table and hash conflict

What is a hash table? Hash tables, also known as hash tables, are array based. This indirectly brings an advantage: the time complexity of search is O(1), and of course, its insertion time complexity is also O(1). There is also a disadvantage: the expansion cost is high after the array is created. There is a "mainstream" idea in hash ...

Posted by ghornet on Thu, 17 Feb 2022 20:40:36 +0100