Pergunta

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 ?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top