Data structure (3. stack)

Catalog 1. Preface 2. Introduction of Stack Content 3. Sequence stack Chain Stack V. Summary 1. Preface This paper mainly introduces the related knowledge of stack and some basic operations of stack. The encapsulated sequential stack and chain stack code are given for direct replication. 2. Introduction of Stack Content A stack is a l ...

Posted by contex on Tue, 28 Dec 2021 04:57:20 +0100

Data structure and algorithm -- 22 Violent matching algorithm, kmp algorithm, greedy algorithm

1. 1. Violence matching algorithm String matching problem: 1) There is a string str1 = "" Silicon Valley is still Silicon Valley, you are still Silicon Valley, you are still Silicon Valley, you are still Silicon Valley, you are still silicon hello "", and a substring str2 = "still Silicon Valley, you are still silico ...

Posted by kemper on Mon, 27 Dec 2021 16:45:23 +0100

7-46 hot topics on Sina Weibo (30 points) (ideas + detailed explanation + set + map)pta click one by one, brothers

1: Title Sina Weibo can embed "topic" in the speech, that is, the topic text in the speech can be written between a pair of "#" to generate a topic link. Click the link to see how many people are discussing the same or similar topics with themselves. Sina Weibo will also update the list of hot topics at any time, and put t ...

Posted by Oaquasis on Mon, 27 Dec 2021 12:47:30 +0100

Java data structure and algorithm

catalogue Huffman coding Principle analysis Basic introduction Best practices - data compression (create Huffman tree) code implementation Operation effect Generate Huffman coding table Partial code Complete code Operation effect Huffman coding Transmitted string 1)I like like like java do you like a java 2)d:1 y:1 u:1 j:2 v:2 o: ...

Posted by cbn_noodles on Mon, 27 Dec 2021 09:20:47 +0100

Algorithm recursion

reference resources Boss blog 1. Understanding of recursion Recursion is to call our own process. We don't have to worry about what each level does. We just need to pay attention to the implementation of a certain level, because each level is the same!!! Recursion can be seen as a simplified version of a loop, and the essence of recursion ca ...

Posted by stanleybb on Mon, 27 Dec 2021 08:44:53 +0100

Scanline algorithm learning - complete analysis of HDU 1542 Atlantis

preface After reading the scan line for a long time, I finally understand it. I want to explain it in my own language to deepen my understanding. Also for readers to learn. Note: before learning this article, you must first understand the operations such as line segment tree and discretization. Here are two articles ...

Posted by maiza on Mon, 27 Dec 2021 08:43:37 +0100

Data structure and algorithm - creation and addition of short linked list

introduce characteristic 1) The first node does not contain data as the chain header (always unchanged), and there is data from the second node 2) Do not use tail pointer, involving tail, circular search; The purpose is different from what I wrote before. It's more interesting! 3) The operation principle and operation logic are basically ...

Posted by fxb9500 on Mon, 27 Dec 2021 01:42:39 +0100

[algorithm interview question series] detailed analysis: the first non repetitive character in the character stream (two methods) and the entry node of the link in the linked list

First non repeating character in JZ54 character stream (medium) subject describe Please implement a function to find the first character that appears only once in the character stream. For example, when only the first two characters "go" are read out from the character stream, the first character that appears only once is " ...

Posted by remlabm on Mon, 27 Dec 2021 00:17:19 +0100

Kingcraft data structure Chapter 8 sorting Hill sorting start

1, Hill sort thinking Firstly, the table to be sorted is divided into several "special" sub tables in the form of L[i,i+d,i+2d,..., i+kd], and each sub table is directly inserted and sorted. Reduce the increment D and repeat the above process until d=1 That is, first pursue the partial order of the elements in the table, and then grad ...

Posted by Trafalger on Sun, 26 Dec 2021 23:50:58 +0100

[Algorithms] Use exercises to teach you how to use dynamic planning, super-detailed, at a glance!! Recommended collection!!

As long as you keep reading it, I'm sure you can learn it!! Preface Definition of Dynamic Planning (DP): Dynamic Planning is an extension of the idea of division, and in a general sense, it is the art of turning big things into small ones and small things into nothing. Dynamic planning has the following three characteristics: ...

Posted by johno on Sun, 26 Dec 2021 10:08:10 +0100