¡@

Home 

c++ Programming Glossary: n2

how to merge two BST's efficiently?

http://stackoverflow.com/questions/1008513/how-to-merge-two-bsts-efficiently

into the other... Complexity of this method being O n1 log n2 .. where n1 is the no of nodes of the tree say T1 which we have.. no of nodes of the tree say T1 which we have splitted and n2 is the number of nodes of the other tree say T2 ... after this.. T2 ... after this operation T2 is the only BST that has n1 n2 nodes... My question is..Can we do any better than O n1 log..

modular arithmetics and NTT (finite field DFT) optimizations

http://stackoverflow.com/questions/18577076/modular-arithmetics-and-ntt-finite-field-dft-optimizations

n DWORD w if n 1 if n 1 dst 0 src 0 return DWORD i j a0 a1 n2 n 1 w2 modmul w w reorder even odd for i 0 j 0 i n2 i j 2 dst.. a0 a1 n2 n 1 w2 modmul w w reorder even odd for i 0 j 0 i n2 i j 2 dst i src j for j 1 i n i j 2 dst i src j recursion NTT_fast.. j for j 1 i n i j 2 dst i src j recursion NTT_fast src dst n2 w2 even NTT_fast src n2 dst n2 n2 w2 odd restore results for..

How do you `realloc` in C++?

http://stackoverflow.com/questions/3482941/how-do-you-realloc-in-c

std vector T t n 0 Then t Type realloc t sizeof Type n2 becomes t.resize n2 If you want to pass pointer into function.. n 0 Then t Type realloc t sizeof Type n2 becomes t.resize n2 If you want to pass pointer into function instead of Foo t use..