title: How to do InOrder traversal with B-Tree?
body: <pre><code>struct BTreeNode {
      bool is_leaf=true;
      std::vector&lt;int&gt; elements;
      std::vector&lt;BTreeNode*&gt; children;
      BTreeNode() {}
      BTreeNode (std::vector&lt;int&gt; v) {
      this-&gt;elements = v;
      }
  };
  
  void traverse(BTreeNode* root) {
    for(int i = 0; i &lt; (int)root-&gt;children.size(); ++i){
      traverse(root-&gt;children[i]);
      cout &lt;&lt; root-&gt;elements[i] &lt;&lt; endl;
    }
    traverse(root-&gt;children[root-&gt;children.size() -1]);
  }
  </code></pre>
  
  <p>My method somehow segfaults. How do we write a correct inOrder Traversal for B-Tree?</p>