Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The Beauty presentation of skiplist without artificial balance based on Natural probability

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Nothing can stop me from marveling at the beauty of simplicity.

Thinking in the middle of the night, I can't sleep. I just get up and read something about Middle Eastern civilization, but I can't read it. Maybe it's the hot flashes. I might as well calm down and write a stream of consciousness article. I mean the kind that doesn't have to think. I'm a little bored by the intricacies of the history of the near East and the Middle East. It's really hard. But can you imagine that the thing I don't have to think about is an algorithm? Aren't algorithms all very difficult? Really is an algorithm, can also be said to be a data structure, this is skiplist.

You can find a large number of in-depth analysis of skiplist information from the Internet, including the analysis of its time complexity and space occupation. But this article is not, because I do not want to consume brain cells on such a beautiful morning, nor can I say that it is in the morning, at 3: 00 am! Notice, I'm the kind of weirdo who doesn't need to sleep and stay energetic.

Here we go.

When it comes to search, the first thing you can think of is almost all kinds of search trees. of course, in fact, HASH is more used in pragmatism, and search trees may be more favored by academics. As for HASH, it can be subject to scalability and requires constant reHASH operations. However, for dynamic nodes, there is a consistent HASH that can be used for reference in a large number of distributed environments, which perfectly solves the scalability problem. Of course, it shows another kind of dynamic beauty, and if you beat the chicken blood again one morning, I will write an analysis. Referring to the difficult expansibility of HASH and reHASH operation, the search tree can in fact be expanded infinitely, but in the process of expansion, it will destroy the balance of the tree, and if it destroys the balance, it will seriously damage the search performance of the search tree. Therefore, in order to maintain a balance in the expansion process, a human intervention is needed, which is the so-called "balance" operation.

No matter for AVL tree, 2-3-4 tree, or derived red-black tree, it is typical of this kind of search tree mentioned above. It would be nice to have a data structure that can be naturally balanced in the expansion process without human intervention at all.

I am a believer in genetic determinism and believe that any outbreak or extinction is determined by primitive basic genes, which is, of course, a manifestation of the butterfly effect. I naturally object to losing weight in the gym, because I believe that thin people are determined by basic factors, and they won't get fat no matter how they eat. It's like arm wrestling. Many people have never practiced it at all, but their natural strength is amazing and they have been practicing in the gym for several years. As soon as these people leave the gym, their muscles disappear and there is more and more fat. This kind of building muscle in the gym, like the AVL tree, the red-black tree, requires constant cost to balance the axe, and for those people with a perfect curve determined by natural genes, it is like skiplist, happy life, free growth.

Introduction to skiplist

I won't introduce this article, but when you baidu, you almost understand all of skiplist, so you don't need to read any more, so more of this article belongs to my own notes.

Insert process to understand skiplist

The following figure shows the plug-in build process of a skiplist:

Skiplist Lookup example

The display of Beauty in skiplist

In the process of drawing, I found that all the words were inadvertently expressed in the diagram, and there was no need for more words. Is this the beauty of simplicity?

Statistical performance! Statistical performance! Statistical performance! Statistical performance! Or statistical performance!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report