Sort By Double

简介:

I have wrote a article which describes how to deal with a complicate data structure “sortable tree”. See here.

As i said, it is so complicate that cann’t be maintain easily.

 

Now, i have found a new fluent way to sort this tree:”Sorting by Double”.

“Sorting by double “ is more convinient than int, because we could always insert a new number in any two double values. For example:

we can insert 0.5 into 0 and 1.

we can insert 0.25 into 0 and 0.5.

0.0125 between 0 and 0.25.

:)

 

The benefit of this design is that you don’t have to reset the sorting value of old nodes.

 

 

Reference:

层次结构的数据库处理(译文)

Storing Hierarchical Data in a Database
目录
相关文章
|
6月前
关于Double范围的思考
关于Double范围的思考
46 1
List strem sum
List strem sum
42 0
C#基础③——类型转换(int转double、double转int、Convert)
不同数据类型间的转换,如:将int类型转换为string类型
|
机器学习/深度学习
计算sum=1+2...+n,要求number和sum的类型都是int,且sum在32位以内~
计算sum=1+2...+n,要求number和sum的类型都是int,且sum在32位以内~
对int,char,float,double进行求和操作
对int,char,float,double进行求和操作
169 0
|
搜索推荐 C++
sort()函数详解
sort()函数详解
118 0
|
NoSQL Redis
SORT
SORT
97 0
Float.compare()和Double.compare()的使用
Float.compare()和Double.compare()的使用
115 0
LeetCode之Two Sum II - Input array is sorted
LeetCode之Two Sum II - Input array is sorted
96 0