Draft
Breadth-First DOM Traversal
24SimplGy
Description:
In this web-based twist on a classic computer science problem, you'll traverse a set of dom-like objects.
The goal is to traverse them "breadth first", so if you have domish nodes that look like this:
a
/ \
b c
/
d
You should traverse them in order a b c d
, not a b d c
.
The structure of these objects is very simple, and similar to a DOM node on a webpage:
let h1 = Node('h1')
let p = Node('p')
let article = Node('article', [h1, p])
article.tagName; // 'article'
article.children; // [h1, p]
article.firstChild; // h1
h1.children; // []
h1.firstChild; // undefined
You shouldn't need to use the construction API but I include it here for completeness.
Algorithms
Similar Kata:
Stats:
Created | Oct 5, 2016 |
Warriors Trained | 129 |
Total Skips | 32 |
Total Code Submissions | 169 |
Total Times Completed | 24 |
JavaScript Completions | 24 |
Total Stars | 3 |
% of votes with a positive feedback rating | 67% of 12 |
Total "Very Satisfied" Votes | 7 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 13 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |