Huffman coding (data structure tree, c language version)

Huffman coding (data structure tree, c language version) 1, Experimental topic 1) Initialization. Read in the weight of each character and establish HuffTree; 2) Code. Coding with the built Huffman tree; 3) Output. Display the established Huffman tree and the corresponding coding table; 1. Data structure //----- storage representation of Hu ...

Posted by akrocks_extreme on Tue, 16 Nov 2021 06:20:09 -0800

P7011-[CERC2013]Escape [heap, heuristic merge]

Topic Title Link: https://www.luogu.com.cn/problem/P7011 General idea of the topic give n n A tree with n points starts from one and goes to t t t. The initial weight value is ...

Posted by nosmasu on Tue, 16 Nov 2021 03:55:50 -0800

Hash table: General hash, string hash (with examples)

storage structure 1. Open addressing method (y general recommendation) The principle of open addressing method is similar to going to the toilet 2. Zipper method Similar to adjacency table String hash mode p-ary 1. Treat the string as a p-ary number 2. Convert the number in p-ary to the number in 10-ary 3. For the whole number modQ In this ...

Posted by ChibiGuy on Fri, 12 Nov 2021 19:15:23 -0800

[problem solving report] (lesson 23) string algorithm - string segmentation

  Zero, write in front           This is the 23rd day of clock in. Today's topic is a little difficult. The main knowledge points are 100 lectures on zero fundamentals of algorithms (Lecture 23) string algorithms (III) - string segmentationhttps://blog.csdn.net/WhereIsHeroFrom/article/details/1208 ...

Posted by Cogen on Fri, 12 Nov 2021 12:15:18 -0800

Java linked list data structure brush notes summary

Java linked list data structure brush notes summary This article has referred to the labuladong algorithm, and has compiled some notes and thoughts. You can pay attention to his official account. I'm a vegetable 555. I've just started to brush questions. I'll take notes here. Hey hey~ Characteristics of linked list Types of linked lists ...

Posted by rn14 on Fri, 12 Nov 2021 07:39:22 -0800

Quick sorting (radish pit filling algorithm) [must know knowledge]

Quick sort   in other words, it's called fast platoon, but it will become slow platoon under certain circumstances. OK, OK, enter the text Fast platoon also adopts a divide and conquer strategy. The basic idea of this method is: 1. Find a base number first. I usually use the first number2. Then, the left side of the square smaller ...

Posted by exa_bit on Fri, 12 Nov 2021 02:56:02 -0800

Priority queue

catalogue Priority queue concept Characteristics of priority queues Note when using priority queues:   Construction of priority queue Operation implementation of priority queue     Priority queue concept First, a queue is a first in, first out (FIFO) Data structure of , but in some cases, The data of the operation may ...

Posted by Lambneck on Thu, 11 Nov 2021 22:10:14 -0800

leetcode circular linked list I & II

1. Circular linked list I 1.1 Title Description The link to this question comes from leetcode Example Advanced and tips: 1.1.1 interface function /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ bool hasCycle(struct ListNode *head) { } 1.2 general fra ...

Posted by ccgorman on Thu, 11 Nov 2021 15:15:50 -0800

Solution of Dutch flag problem: additional space complexity O, time complexity O(N)

Dutch National Flag Problem         a. Given a sequence arr and a number num, put > num on the right of the array and < = num on the left of the array         b. Given a sequence arr and a number num, put > num on the right of the array, < num on the left of the array, and equal in the midd ...

Posted by Paddy on Thu, 11 Nov 2021 00:30:36 -0800

Top ten sorting algorithms (fast sorting, merging, heap sorting and direct insertion) - Java implementation

Bubble sorting Start from the first element of the sequence to be sorted, constantly compare the values of adjacent elements, exchange if it is found that the reverse order, and gradually move the elements with larger values from front to back. Every time the maximum value of the sequence to be sorted is found, the maximum value is fi ...

Posted by almightyegg on Wed, 10 Nov 2021 20:12:43 -0800