[data structure] 2 Stack and queue

[data structure] stack and queue "Be careful! The stack overflows!" ✨✨ Hello, we meet again Follow [sequence list and linked list]( (2 messages) [data structure] 1 Linear table___ exile__ Blog - CSDN blog )Today, let's learn about stacks and queues. 1. Stack 1.1 definition of stack Stack is a special linear t ...

Posted by DonelleJenae on Wed, 06 Apr 2022 16:18:36 +0300

Time complexity O(n) - level sorting algorithm

Theorem 8.1 of introduction to algorithm: in the worst case, any comparison sorting algorithm needs to make O(nlogn) comparisons. Inference 8.2 of introduction to algorithms: heap sorting and merge sorting are both asymptotically optimal comparative sorting algorithms. Therefore, the time complexity O(n) level sorting algorithms are sorting a ...

Posted by creative on Wed, 06 Apr 2022 16:17:58 +0300

Look for relationships in the family tree

[problem description] A common saying when meeting Chinese people with surnames is "we may have been a family 500 years ago". From the file in the current directory Txt, read the names of two people from the standard input (their names will certainly appear in the genealogy), and program to find and judge how many generations the two ...

Posted by versatilewt on Wed, 06 Apr 2022 15:18:31 +0300

[data structure and algorithm learning note Queue]

This article is a learning note. Interested readers can search for "data structure and algorithm Python version" in MOOC or read "data structure (C language version)" (Yan Weimin) 1.2.1 queue abstract data type and its implementation Queue is an ordered data set, which is characterized by: The addition of new data item ...

Posted by jbingman on Wed, 06 Apr 2022 11:18:36 +0300

Analysis of algorithm and data structure

📚 Reference: data structure C Language Edition - Yan Weimin catalogue 1, Single linked list 1.1 initialize single linked list 1.2 implementation of basic operation of single linked list 👻 1.2.1 initialization 👻 Value 1.2   👻 1.2.3 search (search by value) 👻 1.2.4 insertion 👻 1.2.5 delete (delete by location) 👻 1.2.6 cre ...

Posted by ahoo on Wed, 06 Apr 2022 06:16:59 +0300

Chapter 10 Red Black Tree

Chapter 10 Red Black Tree At the beginning of learning mangrove, you must be confused and forced. After learning, you will still be confused and forced Introduction to red black tree Red black tree is also a self balanced binary search tree It used to be called balanced binary B-tree Red black trees must meet the following five prop ...

Posted by creative on Wed, 06 Apr 2022 03:57:16 +0300

LeetCode 2047. Number of valid words in the sentence

1, Title 1. Title Description   sentences consist only of lowercase letters ('a 'to' z '), numbers ('0' to '9'), hyphens ('-'), punctuation ('!', '.' and ','), and spaces ('). Each sentence can be broken down into one or more token s according to spaces, which are separated by one or more spaces'.    if a token meets t ...

Posted by deveed on Wed, 06 Apr 2022 01:11:47 +0300

[2021-MOOC Zhejiang University Chen Yue, he Qinming data structure] tree

1. Find 1.1 static search Sequential search The time complexity of sequential search algorithm is O(n) Binary search The element to find exists The element to find does not exist Binary search algorithm 2. Definition of tree How to judge tree and non tree? 3. Basic terms of tree 4. Repres ...

Posted by nnpdn on Tue, 05 Apr 2022 23:34:30 +0300

Blue Bridge Cup - the fourth C/C + + real topic [provincial competition] [group B]

catalogue 1. Gauss diary (fill in the blank) 2. Careless formula (fill in the blank for the result) 3. The 39th step (fill in the blank) 4. Golden continued score (fill in the blank) 5. Prefix judgment (fill in the blank) 6. Three part sorting (fill in the blank) 7. Wrong ticket (programming problem) 8. Flip a coin (programming problem) ...

Posted by osiris1603 on Tue, 05 Apr 2022 15:19:44 +0300

Pandas data structure: DataFrame [two dimensional array]

2.DataFrame DataFrame is an object similar to two-dimensional array or table (such as excel). It has both row index and column index Row index indicates different rows. The horizontal index is called index, 0 axis, axis=0 Column index, columns with different table names, vertical index, called columns, 1 axis, axis=1 2.1 creation of datafram ...

Posted by PLaT on Tue, 05 Apr 2022 10:39:27 +0300