1

I wrote:

At most, a handle and a pattern can be defined for every node of the tree. For each node a sub-tree, which at most equals the whole DOM-tree, must be revisited; therefore, N is multiplied by N in the formula.

I try to explain the reasons for a formula, I describe the worst case. In the sentence above by "At most" I want to say "the most number of the patterns equals the whole number of nodes of a tree". Did I used "At most" correctly in the right position?

3

Your usage of

at most

is understandable. However,

At most, a handle and a pattern can be defined for every node of the tree.

is usually expressed

Every node of the tree can have at most one handle and one pattern.

When explaining your formula you may want to use "worst case"

The sub-tree of each node must be revisited, which in worst cases will be the entire DOM-tree, giving a worst case scenario of O(N2) in the formula.

since you are trying to describe the time complexity.

  • Every node of the tree can have at most one handle and one pattern, but this is not my intention, as I mentioned in the question, I wan to say the number of handles and patterns at most equals to N (the number of nodes). – Ahmad Dec 26 '16 at 7:58
  • But maybe your sentence also convey the same. – Ahmad Dec 26 '16 at 7:59
  • "At most, a handle and a pattern can be defined for every node of the tree" means 1 handle and 1 pattern per node. Is "every node can have N handles and N patterns" maybe what you want to say? It means nodes to handles or patterns is one-to-many. A sub-tree is different than a handle or a pattern? Just because a node can have a sub-tree does not mean the node has N handles or N patterns where N is the number of nodes in the sub-tree. – Peter Dec 26 '16 at 8:53
  • Yes, in average one handle or pattern is defined for some nodes. At most these nodes can be all the nodes. Matching each pattern may lead to traversing a sub tree. – Ahmad Dec 26 '16 at 9:25
  • At most should not be at the head of the sentence if, as you say, it goes with every. Peter's suggestion to use "in the worst case" instead of at most is spot on. Also, you don't want to use can but will have to be or must be. In the worst case, a handle and a pattern will have to be identified for every node in the tree. – Tᴚoɯɐuo Dec 26 '16 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.