Nothing is going to stop me from being amazed at the beauty of simplicity.
Thinking in the middle of the night, can not sleep, simply get up to see the book, about the Middle East civilization, but also do not see, perhaps the cause of the hot tide ... It's better to write an article of stream of consciousness in silence, I mean the kind that doesn't have to think, I've been a little annoyed by the intricate history of the Near East, the Middle Eastern, that's really hard. Can you imagine, however, that the one thing I'm referring to without thinking is an algorithm? Are algorithms not all that difficult? Really is an algorithm, can also be said to be a data structure, this is skiplist.
Can find a lot of in-depth analysis of skiplist data from the Internet, including analysis of its time complexity, space occupancy situation. But this article is not, because I do not want to be in a good morning to consume brain cells, can not say that it is morning, this time 3 o'clock in the morning the whole!! Notice that I'm the kind of weirdo who doesn't need to sleep and keep energy.
That's the beginning.
When it comes to finding, the first thing you can think of is almost all kinds of search trees, of course, in fact, the pragmatism seems to use more or hash, find the tree may be more favored by college schools. As for the hash, it may be subject to extensibility, requires constant rehash operation, however, for dynamic nodes, there is a consistent hash can be referenced, a large number of distributed environment, it perfectly solves the problem of extensibility. Of course, it embodies another kind of dynamic beauty, if one day in the morning after the chicken blood, will write an analysis. Referring to the non-extensibility of the hash and rehash operation, the search tree can actually be infinitely extensible, but in the extension process, it will destroy the balance of the tree, the damage to the balance will seriously lose the search tree lookup performance, so in order to maintain balance during the expansion process, need an artificial intervention, This kind of intervention is called the "balance" operation.
Whether for the AVL tree, the 2-3-4 tree, or the derived red-black tree, it is typical of such a search tree as described above. If there is a data structure, in the extension process can be naturally balanced, no human intervention at all, that is how good.
I am a believer in genetic determinism, believing that any eruption or fade is determined by the primitive basic genes, which is, of course, a manifestation of the butterfly effect. I naturally oppose the gym weight loss, because I believe that thin people are genetically determined, how to eat will not be fat, like breaking wrist, a lot of people do not practice, but the natural strength is amazing, instantly pulled down in the gym practice for several years, these people once left the gym, immediately muscle becomes disappeared, fat more and more ... This kind of muscle in the gym, like AVL tree, red and black trees, need to spend the cost of constant balance treatise, and for that natural genetic decision to have the perfect curve of people, like skiplist, happy life, free growth.
Skiplist Introduction
This article does not introduce, but when you Baidu, you almost also understand the skiplist of all, also need not continue to look down, so more, this article belongs to my own record essay.
Insert Process Understanding Skiplist
Shows a skiplist insert build process:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/F8/wKiom1WuwZbzL8sNAAPMI2vAZ-A150.jpg "title=" Ski1.jpg "alt=" Wkiom1wuwzbzl8snaapmi2vaz-a150.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/F5/wKioL1Wuw2jzA09eAAUXabeG_R4045.jpg "title=" Ski2.jpg "alt=" Wkiol1wuw2jza09eaauxabeg_r4045.jpg "/>
Skiplist Find Example
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/F8/wKiom1WuwXGwlInKAAD_G2UGFgc396.jpg "title=" Ski3.jpg "alt=" Wkiom1wuwxgwlinkaad_g2ugfgc396.jpg "/>
Skiplist the beauty of the show
In the process of drawing, I found that inadvertently all the words are expressed in the diagram, no more words, this is simple beauty?
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/F5/wKioL1Wuw0TALBKYAAk41VZ35ro941.jpg "title=" Ski4.jpg "alt=" Wkiol1wuw0talbkyaak41vz35ro941.jpg "/>
Statistical Performance! Statistical Performance! Statistical Performance! Statistical Performance! or statistical performance!
The beauty of skiplist without man-made balance based on natural probability