diff --git a/conteudo/index.html b/conteudo/index.html index c9e4479..891db15 100644 --- a/conteudo/index.html +++ b/conteudo/index.html @@ -153,6 +153,7 @@

Árvores


Cite este material

diff --git a/index.xml b/index.xml index a6a73ea..e6454ff 100644 --- a/index.xml +++ b/index.xml @@ -203,6 +203,7 @@ de ordenar dados.</li> <ul> <li><a href="http://joaoarthurbm.github.io/eda/posts/bst">Árvores Binárias de Pesquisa</a></li> <li><a href="//joaoarthurbm.github.io/eda/posts/heap">Heap</a></li> +<li><a href="https://joaoarthurbm.github.io/eda/posts/avl/">Árvores Balanceadas(AVL)</a></li> </ul> <hr> <h3 id="cite-este-material">Cite este material</h3> diff --git a/posts/index.xml b/posts/index.xml index 1bc5789..699cfa3 100644 --- a/posts/index.xml +++ b/posts/index.xml @@ -3352,7 +3352,7 @@ b<span style="color:#f92672">.</span><span style="col <p>Vamos analisar detalhadamente o código do método <em><strong>add(int index, int value)</strong></em> para discutirmos essas preocupações.</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#f92672">...</span> <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">add</span><span style="color:#f92672">(</span><span style="color:#66d9ef">int</span> index<span style="color:#f92672">,</span> Aluno aluno<span style="color:#f92672">)</span> <span style="color:#f92672">{</span> - <span style="color:#66d9ef">if</span> <span style="color:#f92672">(</span>index <span style="color:#f92672">&lt;</span> 0 <span style="color:#f92672">||</span> index <span style="color:#f92672">&gt;</span> size<span style="color:#f92672">)</span> + <span style="color:#66d9ef">if</span> <span style="color:#f92672">(</span>index <span style="color:#f92672">&lt;</span> 0 <span style="color:#f92672">||</span> index <span style="color:#f92672">&gt;=</span> size<span style="color:#f92672">)</span> <span style="color:#66d9ef">throw</span> <span style="color:#66d9ef">new</span> IndexOutOfBoundsException<span style="color:#f92672">();</span> Node newNode <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> Node<span style="color:#f92672">(</span>aluno<span style="color:#f92672">);</span> diff --git a/posts/linkedlist/index.html b/posts/linkedlist/index.html index edaf440..96c4f8e 100644 --- a/posts/linkedlist/index.html +++ b/posts/linkedlist/index.html @@ -303,7 +303,7 @@

Inserção

Vamos analisar detalhadamente o código do método add(int index, int value) para discutirmos essas preocupações.

...
 public void add(int index, Aluno aluno) {
-    if (index < 0 || index > size)
+    if (index < 0 || index >= size)
         throw new IndexOutOfBoundsException();
         
     Node newNode = new Node(aluno);