Help needed for SPOJ — ORDERSET

Revision en4, by rofi93, 2018-09-22 11:02:37

I was trying to solve this problem using AVL tree, but getting RE. Can't find out what I'm doing wrong. Can someone help me ??

Solution — https://ideone.com/l7a0jg

UPDATE

Got AC. The bug was I was accessing directly root->subtree_size without checking if the root is NOT NULL.

Tags #spoj, binary search tree, avl trees

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English rofi93 2018-09-22 11:08:55 122 Tiny change: ' directly root->subtree_size without c' -> ' directly `root->subtree_size` without c'
en4 English rofi93 2018-09-22 11:02:37 125 Tiny change: 'com/l7a0jg' -> 'com/l7a0jg\n\n**UPDATE**\n'
en3 English rofi93 2018-09-20 20:32:20 10
en2 English rofi93 2018-09-20 20:31:21 2 (published)
en1 English rofi93 2018-09-20 20:30:55 238 Initial revision (saved to drafts)