We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
On second thought, a vector would probably be better here because the head to tail to traversal would have better locality. However, this would come with the downside that push_back would be only amoritized O(1) instead of strict O(1) unless capacity can be guessed from the maximum nesting level of tags (+1 for the attribute)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Attribute Parser
You are viewing a single comment's thread. Return to all comments →
On second thought, a vector would probably be better here because the head to tail to traversal would have better locality. However, this would come with the downside that push_back would be only amoritized O(1) instead of strict O(1) unless capacity can be guessed from the maximum nesting level of tags (+1 for the attribute)