I was studying Red Black trees and I was wondering what is the time complexity for assigning black heights for each node when we do a process like insert ?

有帮助吗?

解决方案

Insertion to a Red Black tree costs log(N)...check out this cool link for other complexities of various data structures/algorithms...

http://bigocheatsheet.com/

another useful link showing how insertion/deletion/rearranging of nodes takes place in a red black tree...

http://www.cs.usfca.edu/~galles/visualization/RedBlack.html

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top