ADT -- data structure of binary tree (C language)

(the complete code is at the end of the text and the user manual is attached) Implemented operations         1. Tree initialization         2. Traversal binary tree Traversing binary tree in sequence (non recursive using stack) Middle order traversal binary tree ( ...

Added by ppatwari on Sat, 22 Jan 2022 01:59:49 +0200

Acronyms -- use arrays as hash tables

1. Valid Letter Words Given two strings s and t, write a function to determine whether t is an alphabetic ectopic word of s. Note: if each character in S and t occurs the same number of times, s and T are called alphabetic words. Valid Letter ectopic words Idea: 1. Create an array with a size of 26 to record the number of occurr ...

Added by eduard77 on Fri, 21 Jan 2022 20:54:18 +0200

Experiment 1 of data structure

Experiment 1 physical implementation of linear table Submit two attachments respectively: 1: For the log report file of Experiment 1, please refer to the course specification. 2: Experiment 1 source package. (the file name should also be standardized. Refer to the format of the report file) Experiment 1 linear table experiment log Implementa ...

Added by subwayman on Fri, 21 Jan 2022 18:29:04 +0200

Java: simple understanding and use of LRU caching mechanism for data structure notes

LRU caching mechanism 1. Title Original question link Using the data structure you have mastered, design and implement an LRU (least recently used) caching mechanism. It should support the following operations: get data and write data put. Get data (key) - if the keyword (key) exists in the cache, get the value of the keyword (always pos ...

Added by puritania on Fri, 21 Jan 2022 18:27:47 +0200

Pointer and string

Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it Tip: the following is the main content of this article. The following cases can be used for reference 1, What's the use of pointers 1. Pointer application scenario 1 Exchange the values ...

Added by SephirGaine on Fri, 21 Jan 2022 07:12:30 +0200

Binary tree recursion routine: judge whether the binary tree is the maximum distance of searching binary tree and binary tree

This article continues to talk about the recursive routine of binary trees.1, Determine whether the binary tree is a search binary treeSearch binary tree definition: for any subtree with X as the head in a binary tree, the left subtree is smaller than X and the right subtree is larger than x. (the classic search binary tree has no duplicate val ...

Added by anthony88guy on Fri, 21 Jan 2022 04:47:53 +0200

Detailed analysis of classical dynamic programming problem: Principle Analysis and solution implementation of shortest editing distance algorithm

Basic concepts Edit distance issue: It is difficult to edit the distance problem, but the solution is very beautiful, and it is also a rare practical algorithmEdit the distance usage scenario: For revising the misplaced content of the article The article can only be modified by 20 words, and supports adding, deleting and replacing oper ...

Added by sw9 on Thu, 20 Jan 2022 20:18:55 +0200

Select Sorting Algorithm

Select Sorting Algorithm In order to sort the sequences with less data in ascending or descending order, we can consider using the selective sorting algorithm, whose corresponding time complexity is O(n2). The idea of sorting the sequence containing n elements by sorting algorithm is to find the maximum or minimum value from the sequence to b ...

Added by nafetski on Thu, 20 Jan 2022 15:15:19 +0200

golang special - simple record map usage and underlying implementation

What is a map The Map structure exists in many programming languages, including today's protagonist go language. Today, we will analyze the Map in go in several aspects. In the most popular words, Map is a data structure that obtains value through key. Its underlying storage method is array. The key cannot be repeated during storage. W ...

Added by davestewart on Thu, 20 Jan 2022 13:21:35 +0200

Huffman encoding and decoding based on C + + file

Huffman encoding and decoding of files 1. The global variable count conflicts with std:count. It is recommended to use other variable names.2. Memory leakage. Note that the space should be open enough that the pointer cannot cross the boundary. The stack space opened in the main function is generally 8MB. If you want to open a large array, ple ...

Added by IceDragon on Thu, 20 Jan 2022 11:51:25 +0200