Decrypt QQ number - queue
The new semester begins. Xiaoha is xiaohum's new deskmate (xiaoha is a little beauty). Xiaohum asks xiaoha about the QQ number. Of course, xiaoha won't tell xiaohum directly. You know the reason. So xiaoha gave xiaohum a string of encrypted numbers, and xiaoha also told xiaohum the decryption rules. The rule is as f ...
Posted by srikanthiv on Mon, 23 May 2022 14:04:57 +0300
If the insertion order of nodes in a binary sort tree is random, the binary sort tree established in this way is balanced in most cases. It can be proved that its high expectation value is \ (O (\ log_2 n) \). Even if there are some extreme cases, the probability of this happening is very small. Moreover, the operation of the binary sort tree e ...
Posted by robindean on Mon, 23 May 2022 05:59:12 +0300
List three common sets
ArrayList is a typical implementation class and main implementation class of the List interface. In essence, ArrayList is a "variable length" array of object references.
ArrayList class is an array that can be dynamically modified. The difference from ordinary arrays is that it has no f ...
Posted by techcone on Sun, 22 May 2022 10:18:32 +0300
Based on the realization of two-dimensional sparse array, I will sort out the concept and application of sparse array.
In fact, it is still an array. Through the regulations, the elements of the array are given specific meanings, and the array with a small amount of data but a large space is saved with a small storage space.
Posted by RaythMistwalker on Sun, 22 May 2022 07:53:07 +0300
1. What is Bubble sorting？
Bubble Sort is the most basic exchange sort. The reason why it is called bubble sorting is that each element can be sorted bit by bit according to its own size like a small bubble array Move to one side of the.
Principle of bubble sorting:
Only one number can be determined to be returned in each tr ...
Chained stack is a data storage structure, which can be implemented in the form of a singly linked list. The advantage of using a chained stack is that it can overcome the low space utilization of sequential stacks implemented with arrays, but it needs to be used for each stack element. Allocate additional pointer space for storing ...
Posted by roughie on Sun, 22 May 2022 02:28:20 +0300
Improvement of binary tree traversal algorithm
The depth first traversal algorithms of binary tree are implemented by recursive functions, which is very inefficient. The reason is that the system calls a stack and does complex operations such as protecting the site and restoring the site, so that the traversal can be realized by very simple cod ...
Posted by Verrou on Sun, 22 May 2022 02:06:38 +0300
Common interview questions of single linked list
Find the number of effective nodes in the single linked list
Find the penultimate node in the single lin k ed list (Sina)
Reversal of single linked list (Tencent)
Print the single linked list from end to end (Baidu requires mode 1: reverse traversal. Mode 2: stack stack)
Example 1: find the ...
Merge sort is a very typical application of divide and conquer. The idea of merging and sorting is to recursively decompose the array, and then merge the array.
After the array is decomposed to the minimum, and then two ordered arrays are merged. The basic idea is to compare the front numbers of the two arrays. Whoever is small will ...
Posted by adam_gardner on Sat, 21 May 2022 05:32:56 +0300
Big talk data structure - Summary
Read the book "Dahua data structure" and summarize some things; The summary is rough. Some ideas can't be understood for the time being. Put them aside first, and then go back to digest these knowledge points after learning other things
1. Data structure
A data structure is a collection of ...
Posted by redrabbit on Sat, 21 May 2022 01:17:44 +0300