Data structure - stack (Ⅳ)

Data structure - stack (Chapter 3) sorting notes. If there are errors, please correct them. Sequence table Single linked list Stack of base book exercise do ...

Posted by EGNJohn on Sun, 02 Jan 2022 13:39:37 +0100

LeetCode problem brushing learning

First day of study I use C + +, please forgive me for the mistakes. The original intention of the article is only to urge me to study. If it happens to be able to help you, I will be very happy. preface 1, 141 Circular linked list Title: give you a head node of the linked list to judge whether there are links in the linked list. ...

Posted by nainil on Sun, 02 Jan 2022 06:21:54 +0100

C + + demonstrates the breadth traversal and depth traversal of undirected graphs

A little white ~ ~ ~ directly on the report and code [problem description] Write a program to demonstrate the traversal operation of undirected graph. [basic requirements] Taking adjacency table as storage structure, the depth first and breadth first traversal of connected undirected graph are realized by recursive algorithm.With the help o ...

Posted by siobhan on Sun, 02 Jan 2022 03:22:16 +0100

Basic sorting algorithm

Sorting algorithmAverage time complexityWorst time complexitySpatial complexityData object stabilityBubble sortingO( n 2 n^{2} n2)O( ...

Posted by Devil_Banner on Sat, 01 Jan 2022 17:09:09 +0100

leetcode_987. Vertical traversal of binary tree -- leetcode's way to brush questions

Title Description Give you the root node of the binary tree, root. Please design an algorithm to calculate the vertical traversal sequence of the binary tree. For each node located in (row, col), its left and right child nodes are located in (row + 1, col - 1) and (row + 1, col + 1). The root node of the tree is located at (0, 0). The ve ...

Posted by Stopofeger on Sat, 01 Jan 2022 16:28:42 +0100

Binary search tree

Binary search tree concept Binary search tree is also called binary sort tree. It is either an empty tree or a binary tree with the following properties: If its left subtree is not empty, the values of all nodes on the left subtree are less than those of the root node If its right subtree is not empty, the values of all nodes on the right ...

Posted by jossejf on Sat, 01 Jan 2022 14:42:12 +0100

Data structure course design: quick sorting

Problem Description: For the linear table stored in order (assuming that the order table is not empty), use vector or array to realize the quick sorting algorithm and output the sorting results of each trip. Reference function prototype: (vector version) (1) / / implementation of quick sort (shell) template<class ElemType> voi ...

Posted by brmcdani on Sat, 01 Jan 2022 10:16:20 +0100

CCF CSP command line options

subject Problem description Please write a command line analyzer to analyze which options are included in a given command line. Each command line consists of several strings separated by exactly one space. The first of these strings is the name of the command-line tool, which is composed of lowercase letters. Your program does not need ...

Posted by merylvingien on Fri, 31 Dec 2021 23:02:42 +0100

Data structure point divide and conquer

Original title Given a tree with N points (No. 0,1,..., N − 1), each edge has a weight (no more than 1000). The path length between two nodes x and y in the tree is the sum of the weights of each edge on the path. Find the number of paths whose length does not exceed K. Input format The input contains multiple sets of test cases. The ...

Posted by DangerousDave86 on Fri, 31 Dec 2021 16:13:08 +0100

My roommate learned the hash table only on the last day of 2021

Hash concept A one-to-one mapping relationship can be established between the storage location of an element and its key through a function (hashFunc), so the element can be found quickly during search The conversion function used in the hash method is called hash (hash) function, and the structure constructed is called hash table (o ...

Posted by daucoin on Fri, 31 Dec 2021 13:16:42 +0100