juan_gandhi: (Default)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote2018-07-16 09:53 pm
Entry tags:

кстати о двоичных деревьях

Сегодня на работе сюрприз. Пришлось мне в XmlObject  вставлять другие XmlObjects, как children. И вот вдруг обнаружил - коли ты его куда-то вставляешь, то у него имя изменяется! Вставь в два объекта - ну соответственно.

Нет, ну я думал, что эта эпоха идиотов давно прошла, лет 10 назад. Ан нет. Они все там же.
lev: (Default)

[personal profile] lev 2018-07-17 05:08 am (UTC)(link)
Имя?

[personal profile] sassa_nf 2018-07-17 11:30 am (UTC)(link)
I don't see getName there. I see cursor.getName(). That's QName, or qualified name. It will change, if namespace changes. getLocalPart() should stay the same.
lev: (Default)

[personal profile] lev 2018-07-17 01:57 pm (UTC)(link)
и как можно один XO вставить в два других?
lev: (Default)

[personal profile] lev 2018-07-17 04:13 pm (UTC)(link)
как вы себе представляете дерево, которое может принадлежать нескольким деревьям?

[personal profile] sassa_nf 2018-07-17 06:45 pm (UTC)(link)
"Это как у элементов множества хранить ссылку на множество"

No, it's like for a function A->B, knowing B you can find A. Axiom of choice?..

[personal profile] sassa_nf 2018-07-17 07:27 pm (UTC)(link)
Not an arbitrary function, but a function Parent->[Child], or [Parent->Child_i].

The sets of children may intersect, then, of course, you can't have the inverse, Child_i->Parent. But when you do have the inverse, then you can't have the intersecting sets of children.
lev: (Default)

[personal profile] lev 2018-07-18 05:01 am (UTC)(link)
так опен сорс же, возможно только вашего дерева и не хватает.