<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
>
	<channel>
		<title>Dudas de Programacion &#187; Tag: vector - Recent Posts</title>
		<link>http://www.dudasprogramacion.com/tags/vector</link>
		<description>Dudas sobre lenguajes y apis de programación</description>
		<language>en-US</language>
		<pubDate>Tue, 07 Feb 2012 21:33:42 +0000</pubDate>
		<generator>bbpress 1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.dudasprogramacion.com/search.php</link>
		</textInput>
		<atom:link href="http://www.dudasprogramacion.com/rss/tags/vector" rel="self" type="application/rss+xml" />

		<item>
			<title>fiurer87 on "Una duda con arreglos(basico)"</title>
			<link>http://www.dudasprogramacion.com/topic/una-duda-con-arreglosbasico#post-551</link>
			<pubDate>Fri, 23 Jul 2010 14:59:38 +0000</pubDate>
			<dc:creator>fiurer87</dc:creator>
			<guid isPermaLink="false">551@http://www.dudasprogramacion.com/</guid>
			<description><p>en caso de que quieras crear una funcion que busque un elemento y retorne el indice es mas sencillo.<br />
Esta funcion retornara -1 si es que no hallo el elemento, en caso de que existan el elemento en mas de una posicion solo tomara en cuenta la primera coincidencia y retorara el indice-posicion donde se hallo el elemento.</p>
<pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> posicionElemento<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x, <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> arreglo<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>arreglo.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
       <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>arreglo<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>x<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span> i<span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;</pre></description>
		</item>
		<item>
			<title>fiurer87 on "Una duda con arreglos(basico)"</title>
			<link>http://www.dudasprogramacion.com/topic/una-duda-con-arreglosbasico#post-550</link>
			<pubDate>Fri, 23 Jul 2010 14:53:33 +0000</pubDate>
			<dc:creator>fiurer87</dc:creator>
			<guid isPermaLink="false">550@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas sugerencias.<br />
Pero hay que preguntarse que pasa si el elemento que buscas existe en mas de una posicion, en tal caso deberias imprimir todas las posiciones donde se encuentra.</p>
<p>Aquí la mía.</p>
<pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> buscarElemento<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">boolean</span> estado <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>arreglo.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>arreglo<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>x<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Posicion: &quot;</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         estado <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>estado<span style="color: #009900;">&#41;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Elemento no encontrado&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;</pre></description>
		</item>
		<item>
			<title>Torres on "Una duda con arreglos(basico)"</title>
			<link>http://www.dudasprogramacion.com/topic/una-duda-con-arreglosbasico#post-549</link>
			<pubDate>Fri, 23 Jul 2010 06:45:23 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">549@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas,</p>
<p>como te comenta garusis el problema es que tenías dentro del bucle la línea que imprimía por pantalla.</p>
<p>No se si estás practicando o necesitas usar los arreglos para algo más, pero por informarte que sepas que existe una clase de utilidades en Java para el manejo de arreglos.</p>
<p><a href="http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/java/util/Arrays.html" rel="nofollow">http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/java/util/Arrays.html</a></p>
<p>Y ya trae unos métodos para la búsqueda optimizados, un ejemplo de lo que tu quieres hacer hecho con esta clase de utilidades:</p>
<pre class="java" style="font-family:monospace;">&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Arrays</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Prueba <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param args
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	<span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> listaEnteros <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">5</span>, <span style="color: #cc66cc;">7</span>, <span style="color: #cc66cc;">28</span>, <span style="color: #cc66cc;">49</span>, <span style="color: #cc66cc;">88</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">150</span>, <span style="color: #cc66cc;">336</span>, <span style="color: #cc66cc;">500</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    	<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aarrays+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Arrays</span></a>.<span style="color: #006633;">sort</span><span style="color: #009900;">&#40;</span>listaEnteros<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aarrays+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Arrays</span></a>.<span style="color: #006633;">binarySearch</span><span style="color: #009900;">&#40;</span>listaEnteros, <span style="color: #cc66cc;">88</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;</pre></description>
		</item>
		<item>
			<title>garusis on "Una duda con arreglos(basico)"</title>
			<link>http://www.dudasprogramacion.com/topic/una-duda-con-arreglosbasico#post-548</link>
			<pubDate>Fri, 23 Jul 2010 02:13:20 +0000</pubDate>
			<dc:creator>garusis</dc:creator>
			<guid isPermaLink="false">548@http://www.dudasprogramacion.com/</guid>
			<description><p>pues... en tu lugar, eliminaria el else del ciclo... si te fijas, es totalmente innecesario, ya que si no entra por el if, el valor de enc seguira siendo false. si es necesario que muestre el mensaje de que el elemento no fue encontrado, entonces puedes agregar un if al final comprobando si lo encontro o no... algo asi:</p>
<pre class="java" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> buscarElem<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #000066; font-weight: bold;">boolean</span> enc <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>arreglo.<span style="color: #006633;">length</span> <span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">38</span><span style="color: #339933;">;&amp;</span>#<span style="color: #cc66cc;">38</span><span style="color: #339933;">;</span> <span style="color: #339933;">!</span>enc<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">       <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>arreglo<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>x<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">       <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">           enc <span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">           <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;elemento encontrado:&quot;</span><span style="color: #339933;">+</span> x<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">       <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   i<span style="color: #339933;">++;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>enc<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">       <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;elemento no encontrado:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div></li></ol></pre></description>
		</item>
		<item>
			<title>saintmauricioxd on "Una duda con arreglos(basico)"</title>
			<link>http://www.dudasprogramacion.com/topic/una-duda-con-arreglosbasico#post-547</link>
			<pubDate>Thu, 22 Jul 2010 23:42:59 +0000</pubDate>
			<dc:creator>saintmauricioxd</dc:creator>
			<guid isPermaLink="false">547@http://www.dudasprogramacion.com/</guid>
			<description><p>Bueno stoy empezando con arreglos y tengo una duda con este codigo:</p>
<pre class="java" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> buscarElem<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000066; font-weight: bold;">int</span> res<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000066; font-weight: bold;">boolean</span> enc <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>arreglo.<span style="color: #006633;">length</span> <span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">38</span><span style="color: #339933;">;&amp;</span>#<span style="color: #cc66cc;">38</span><span style="color: #339933;">;</span> <span style="color: #339933;">!</span>enc<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>arreglo<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>x<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                enc <span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                res<span style="color: #339933;">=</span>x<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;elemento encontrado:&quot;</span><span style="color: #339933;">+</span> res<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  enc <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;elemento no encontrado.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                i<span style="color: #339933;">++;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #009900;">&#125;</span></div></li></ol></pre>
<p>esto busca un elemento en el arreglo y lo devuelve, funciona correctamente pero lo q no logro solucionar esq digamos cuando encuentra un elemento en la posicion 6 me imprime para los indices del 0-4 "elemento no encontrado." y el 5 devuelve el numero, eso quiero q me notifique pero sin que repita tantas veces los indices "elemento no encontrado" al recorrer la lista, alguna sugerencia es bienvenida muchas gracias de antemano.
</p></description>
		</item>
		<item>
			<title>lineadecodigo on "ordenar un vector de Strings?"</title>
			<link>http://www.dudasprogramacion.com/topic/ordenar-un-vector-de-strings#post-43</link>
			<pubDate>Sun, 22 Mar 2009 19:43:47 +0000</pubDate>
			<dc:creator>lineadecodigo</dc:creator>
			<guid isPermaLink="false">43@http://www.dudasprogramacion.com/</guid>
			<description><p>@bones, como te comenta chuidiang el método sort es el que ayuda a realizar ordenaciones en Java.</p>
<p>Te dejo la URL con un ejemplo asociado:<br />
<a href="http://lineadecodigo.com/2009/03/22/ordenar-un-vector-de-string-en-java/" rel="nofollow">http://lineadecodigo.com/2009/03/22/ordenar-un-vector-de-string-en-java/</a></p>
<p>Espero que te sirva.
</p></description>
		</item>
		<item>
			<title>chuidiang on "ordenar un vector de Strings?"</title>
			<link>http://www.dudasprogramacion.com/topic/ordenar-un-vector-de-strings#post-31</link>
			<pubDate>Sun, 15 Mar 2009 12:25:07 +0000</pubDate>
			<dc:creator>chuidiang</dc:creator>
			<guid isPermaLink="false">31@http://www.dudasprogramacion.com/</guid>
			<description><p>Hola:</p>
<p>La clase Arrays de java tiene métodos sort() para ordenar arrays de cosas, por ejemplo, Strings.</p>
<p>Se bueno.
</p></description>
		</item>
		<item>
			<title>bones18 on "ordenar un vector de Strings?"</title>
			<link>http://www.dudasprogramacion.com/topic/ordenar-un-vector-de-strings#post-21</link>
			<pubDate>Wed, 11 Mar 2009 23:42:34 +0000</pubDate>
			<dc:creator>bones18</dc:creator>
			<guid isPermaLink="false">21@http://www.dudasprogramacion.com/</guid>
			<description><p>wuenas..</p>
<p>necesito ordenadar una array[] de Strings, por orden alfabetico se entiende.</p>
<p>puedo utilizar el quicksort o mergesort? o me toca pensar el algoritmo?,<br />
si se puede hacer con el quick o el merge como lo hago? </p>
<p>gracias
</p></description>
		</item>
		<item>
			<title>admin on "Bienvenidos al foro Java Util"</title>
			<link>http://www.dudasprogramacion.com/topic/bienvenidos-al-foro-java-util#post-11</link>
			<pubDate>Wed, 04 Mar 2009 00:56:26 +0000</pubDate>
			<dc:creator>admin</dc:creator>
			<guid isPermaLink="false">11@http://www.dudasprogramacion.com/</guid>
			<description><p>Daros la bienvenida al foro sobre dudas de la librería java.util de Java. Colecciones, Vectores, Mapas, Iteradores,...
</p></description>
		</item>

	</channel>
</rss>

