4490 lines
271 KiB
HTML
4490 lines
271 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (version 1.7.0_51) on Wed Apr 06 13:11:12 EDT 2016 -->
|
|
<title>Searching (Parallel Java 2 Library Documentation)</title>
|
|
<meta name="date" content="2016-04-06">
|
|
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="Searching (Parallel Java 2 Library Documentation)";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a name="navbar_top">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/Searching.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../edu/rit/util/RandomSubset.html" title="class in edu.rit.util"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?edu/rit/util/Searching.html" target="_top">Frames</a></li>
|
|
<li><a href="Searching.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li><a href="#nested_class_summary">Nested</a> | </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle">edu.rit.util</div>
|
|
<h2 title="Class Searching" class="title">Class Searching</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>edu.rit.util.Searching</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="strong">Searching</span>
|
|
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
|
|
<div class="block">Class Searching provides static methods for searching arrays of primitive
|
|
types and object types.
|
|
<P>
|
|
<I>Note:</I> The operations in class Searching are not multiple thread safe.</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="nested_class_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Nested Class Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
|
|
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Class and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a></strong></code>
|
|
<div class="block">Class Searching.Byte is the base class for a helper object used to
|
|
search an array of type <TT>byte[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a></strong></code>
|
|
<div class="block">Class Searching.Character is the base class for a helper object used to
|
|
search an array of type <TT>char[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Comparable.html" title="class in edu.rit.util">Searching.Comparable</a><<a href="../../../edu/rit/util/Searching.Comparable.html" title="type parameter in Searching.Comparable">T</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><<a href="../../../edu/rit/util/Searching.Comparable.html" title="type parameter in Searching.Comparable">T</a>>></strong></code>
|
|
<div class="block">Class Searching.Comparable is the base class for a helper object used to
|
|
search an array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a></strong></code>
|
|
<div class="block">Class Searching.Double is the base class for a helper object used to
|
|
search an array of type <TT>double[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a></strong></code>
|
|
<div class="block">Class Searching.Float is the base class for a helper object used to
|
|
search an array of type <TT>float[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a></strong></code>
|
|
<div class="block">Class Searching.Integer is the base class for a helper object used to
|
|
search an array of type <TT>int[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a></strong></code>
|
|
<div class="block">Class Searching.Long is the base class for a helper object used to
|
|
search an array of type <TT>long[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><<a href="../../../edu/rit/util/Searching.Object.html" title="type parameter in Searching.Object">T</a>></strong></code>
|
|
<div class="block">Class Searching.Object is the base class for a helper object used to
|
|
search an array of type <TT>T[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a></strong></code>
|
|
<div class="block">Class Searching.Short is the base class for a helper object used to
|
|
search an array of type <TT>short[]</TT>.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.AList, T)">searchInterval</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a)</code>
|
|
<div class="block">Search the given ordered comparable object list for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.AList, T, java.util.Comparator)">searchInterval</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search the given ordered object list for an interval containing the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.AList, T, edu.rit.util.Searching.Object)">searchInterval</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search the given ordered object list for an interval containing the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(byte[], byte)">searchInterval</a></strong>(byte[] x,
|
|
byte a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(byte[], byte, edu.rit.util.Searching.Byte)">searchInterval</a></strong>(byte[] x,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(byte[], int, int, byte)">searchInterval</a></strong>(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(byte[], int, int, byte, edu.rit.util.Searching.Byte)">searchInterval</a></strong>(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(char[], char)">searchInterval</a></strong>(char[] x,
|
|
char a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(char[], char, edu.rit.util.Searching.Character)">searchInterval</a></strong>(char[] x,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(char[], int, int, char)">searchInterval</a></strong>(char[] x,
|
|
int off,
|
|
int len,
|
|
char a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(char[], int, int, char, edu.rit.util.Searching.Character)">searchInterval</a></strong>(char[] x,
|
|
int off,
|
|
int len,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(double[], double)">searchInterval</a></strong>(double[] x,
|
|
double a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(double[], double, edu.rit.util.Searching.Double)">searchInterval</a></strong>(double[] x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(double[], int, int, double)">searchInterval</a></strong>(double[] x,
|
|
int off,
|
|
int len,
|
|
double a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(double[], int, int, double, edu.rit.util.Searching.Double)">searchInterval</a></strong>(double[] x,
|
|
int off,
|
|
int len,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.DoubleList, double)">searchInterval</a></strong>(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a)</code>
|
|
<div class="block">Search the given ordered double list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.DoubleList, double, edu.rit.util.Searching.Double)">searchInterval</a></strong>(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search the given ordered double list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(float[], float)">searchInterval</a></strong>(float[] x,
|
|
float a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(float[], float, edu.rit.util.Searching.Float)">searchInterval</a></strong>(float[] x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(float[], int, int, float)">searchInterval</a></strong>(float[] x,
|
|
int off,
|
|
int len,
|
|
float a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(float[], int, int, float, edu.rit.util.Searching.Float)">searchInterval</a></strong>(float[] x,
|
|
int off,
|
|
int len,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.FloatList, float)">searchInterval</a></strong>(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a)</code>
|
|
<div class="block">Search the given ordered float list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.FloatList, float, edu.rit.util.Searching.Float)">searchInterval</a></strong>(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search the given ordered float list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(int[], int)">searchInterval</a></strong>(int[] x,
|
|
int a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(int[], int, int, int)">searchInterval</a></strong>(int[] x,
|
|
int off,
|
|
int len,
|
|
int a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(int[], int, int, int, edu.rit.util.Searching.Integer)">searchInterval</a></strong>(int[] x,
|
|
int off,
|
|
int len,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(int[], int, edu.rit.util.Searching.Integer)">searchInterval</a></strong>(int[] x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.IntList, int)">searchInterval</a></strong>(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a)</code>
|
|
<div class="block">Search the given ordered integer list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.IntList, int, edu.rit.util.Searching.Integer)">searchInterval</a></strong>(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search the given ordered integer list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(long[], int, int, long)">searchInterval</a></strong>(long[] x,
|
|
int off,
|
|
int len,
|
|
long a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(long[], int, int, long, edu.rit.util.Searching.Long)">searchInterval</a></strong>(long[] x,
|
|
int off,
|
|
int len,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(long[], long)">searchInterval</a></strong>(long[] x,
|
|
long a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(long[], long, edu.rit.util.Searching.Long)">searchInterval</a></strong>(long[] x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.LongList, long)">searchInterval</a></strong>(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a)</code>
|
|
<div class="block">Search the given ordered long integer list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(edu.rit.util.LongList, long, edu.rit.util.Searching.Long)">searchInterval</a></strong>(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search the given ordered long integer list for an interval containing the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(short[], int, int, short)">searchInterval</a></strong>(short[] x,
|
|
int off,
|
|
int len,
|
|
short a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(short[], int, int, short, edu.rit.util.Searching.Short)">searchInterval</a></strong>(short[] x,
|
|
int off,
|
|
int len,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
an interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(short[], short)">searchInterval</a></strong>(short[] x,
|
|
short a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(short[], short, edu.rit.util.Searching.Short)">searchInterval</a></strong>(short[] x,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(T[], int, int, T)">searchInterval</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(T[], int, int, T, java.util.Comparator)">searchInterval</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for an
|
|
interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(T[], int, int, T, edu.rit.util.Searching.Object)">searchInterval</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for an
|
|
interval containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(T[], T)">searchInterval</a></strong>(T[] x,
|
|
T a)</code>
|
|
<div class="block">Search the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for an interval containing the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(T[], T, java.util.Comparator)">searchInterval</a></strong>(T[] x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchInterval(T[], T, edu.rit.util.Searching.Object)">searchInterval</a></strong>(T[] x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for an interval
|
|
containing the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.AList, T)">searchSorted</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a)</code>
|
|
<div class="block">Search the given ordered comparable object list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.AList, T, java.util.Comparator)">searchSorted</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search the given ordered object list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.AList, T, edu.rit.util.Searching.Object)">searchSorted</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search the given ordered object list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(byte[], byte)">searchSorted</a></strong>(byte[] x,
|
|
byte a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(byte[], byte, edu.rit.util.Searching.Byte)">searchSorted</a></strong>(byte[] x,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(byte[], int, int, byte)">searchSorted</a></strong>(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(byte[], int, int, byte, edu.rit.util.Searching.Byte)">searchSorted</a></strong>(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(char[], char)">searchSorted</a></strong>(char[] x,
|
|
char a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(char[], char, edu.rit.util.Searching.Character)">searchSorted</a></strong>(char[] x,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(char[], int, int, char)">searchSorted</a></strong>(char[] x,
|
|
int off,
|
|
int len,
|
|
char a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(char[], int, int, char, edu.rit.util.Searching.Character)">searchSorted</a></strong>(char[] x,
|
|
int off,
|
|
int len,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(double[], double)">searchSorted</a></strong>(double[] x,
|
|
double a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(double[], double, edu.rit.util.Searching.Double)">searchSorted</a></strong>(double[] x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(double[], int, int, double)">searchSorted</a></strong>(double[] x,
|
|
int off,
|
|
int len,
|
|
double a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(double[], int, int, double, edu.rit.util.Searching.Double)">searchSorted</a></strong>(double[] x,
|
|
int off,
|
|
int len,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.DoubleList, double)">searchSorted</a></strong>(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a)</code>
|
|
<div class="block">Search the given ordered double list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.DoubleList, double, edu.rit.util.Searching.Double)">searchSorted</a></strong>(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search the given ordered double list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(float[], float)">searchSorted</a></strong>(float[] x,
|
|
float a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(float[], float, edu.rit.util.Searching.Float)">searchSorted</a></strong>(float[] x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(float[], int, int, float)">searchSorted</a></strong>(float[] x,
|
|
int off,
|
|
int len,
|
|
float a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(float[], int, int, float, edu.rit.util.Searching.Float)">searchSorted</a></strong>(float[] x,
|
|
int off,
|
|
int len,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.FloatList, float)">searchSorted</a></strong>(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a)</code>
|
|
<div class="block">Search the given ordered float list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.FloatList, float, edu.rit.util.Searching.Float)">searchSorted</a></strong>(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search the given ordered float list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(int[], int)">searchSorted</a></strong>(int[] x,
|
|
int a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(int[], int, int, int)">searchSorted</a></strong>(int[] x,
|
|
int off,
|
|
int len,
|
|
int a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(int[], int, int, int, edu.rit.util.Searching.Integer)">searchSorted</a></strong>(int[] x,
|
|
int off,
|
|
int len,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(int[], int, edu.rit.util.Searching.Integer)">searchSorted</a></strong>(int[] x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.IntList, int)">searchSorted</a></strong>(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a)</code>
|
|
<div class="block">Search the given ordered integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.IntList, int, edu.rit.util.Searching.Integer)">searchSorted</a></strong>(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search the given ordered integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(long[], int, int, long)">searchSorted</a></strong>(long[] x,
|
|
int off,
|
|
int len,
|
|
long a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(long[], int, int, long, edu.rit.util.Searching.Long)">searchSorted</a></strong>(long[] x,
|
|
int off,
|
|
int len,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(long[], long)">searchSorted</a></strong>(long[] x,
|
|
long a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(long[], long, edu.rit.util.Searching.Long)">searchSorted</a></strong>(long[] x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.LongList, long)">searchSorted</a></strong>(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a)</code>
|
|
<div class="block">Search the given ordered long integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(edu.rit.util.LongList, long, edu.rit.util.Searching.Long)">searchSorted</a></strong>(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search the given ordered long integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(short[], int, int, short)">searchSorted</a></strong>(short[] x,
|
|
int off,
|
|
int len,
|
|
short a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(short[], int, int, short, edu.rit.util.Searching.Short)">searchSorted</a></strong>(short[] x,
|
|
int off,
|
|
int len,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(short[], short)">searchSorted</a></strong>(short[] x,
|
|
short a)</code>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(short[], short, edu.rit.util.Searching.Short)">searchSorted</a></strong>(short[] x,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(T[], int, int, T)">searchSorted</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(T[], int, int, T, java.util.Comparator)">searchSorted</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(T[], int, int, T, edu.rit.util.Searching.Object)">searchSorted</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for the
|
|
given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(T[], T)">searchSorted</a></strong>(T[] x,
|
|
T a)</code>
|
|
<div class="block">Search the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(T[], T, java.util.Comparator)">searchSorted</a></strong>(T[] x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchSorted(T[], T, edu.rit.util.Searching.Object)">searchSorted</a></strong>(T[] x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.AList, T)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a)</code>
|
|
<div class="block">Search the given unordered comparable object list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.AList, T, java.util.Comparator)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search the given unordered object list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.AList, T, edu.rit.util.Searching.Object)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search the given unordered object list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(byte[], byte)">searchUnsorted</a></strong>(byte[] x,
|
|
byte a)</code>
|
|
<div class="block">Search the given unordered array of type <TT>byte[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(byte[], byte, edu.rit.util.Searching.Byte)">searchUnsorted</a></strong>(byte[] x,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>byte[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(byte[], int, int, byte)">searchUnsorted</a></strong>(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>byte[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(byte[], int, int, byte, edu.rit.util.Searching.Byte)">searchUnsorted</a></strong>(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>byte[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(char[], char)">searchUnsorted</a></strong>(char[] x,
|
|
char a)</code>
|
|
<div class="block">Search the given unordered array of type <TT>char[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(char[], char, edu.rit.util.Searching.Character)">searchUnsorted</a></strong>(char[] x,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>char[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(char[], int, int, char)">searchUnsorted</a></strong>(char[] x,
|
|
int off,
|
|
int len,
|
|
char a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>char[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(char[], int, int, char, edu.rit.util.Searching.Character)">searchUnsorted</a></strong>(char[] x,
|
|
int off,
|
|
int len,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>char[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(double[], double)">searchUnsorted</a></strong>(double[] x,
|
|
double a)</code>
|
|
<div class="block">Search the given unordered array of type <TT>double[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(double[], double, edu.rit.util.Searching.Double)">searchUnsorted</a></strong>(double[] x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>double[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(double[], int, int, double)">searchUnsorted</a></strong>(double[] x,
|
|
int off,
|
|
int len,
|
|
double a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>double[]</TT>
|
|
for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(double[], int, int, double, edu.rit.util.Searching.Double)">searchUnsorted</a></strong>(double[] x,
|
|
int off,
|
|
int len,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>double[]</TT>
|
|
for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.DoubleList, double)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a)</code>
|
|
<div class="block">Search the given unordered double list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.DoubleList, double, edu.rit.util.Searching.Double)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</code>
|
|
<div class="block">Search the given unordered double list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(float[], float)">searchUnsorted</a></strong>(float[] x,
|
|
float a)</code>
|
|
<div class="block">Search the given unordered array of type <TT>float[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(float[], float, edu.rit.util.Searching.Float)">searchUnsorted</a></strong>(float[] x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>float[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(float[], int, int, float)">searchUnsorted</a></strong>(float[] x,
|
|
int off,
|
|
int len,
|
|
float a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>float[]</TT>
|
|
for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(float[], int, int, float, edu.rit.util.Searching.Float)">searchUnsorted</a></strong>(float[] x,
|
|
int off,
|
|
int len,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>float[]</TT>
|
|
for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.FloatList, float)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a)</code>
|
|
<div class="block">Search the given unordered float list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.FloatList, float, edu.rit.util.Searching.Float)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</code>
|
|
<div class="block">Search the given unordered float list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(int[], int)">searchUnsorted</a></strong>(int[] x,
|
|
int a)</code>
|
|
<div class="block">Search the given unordered array of type <TT>int[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(int[], int, int, int)">searchUnsorted</a></strong>(int[] x,
|
|
int off,
|
|
int len,
|
|
int a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>int[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(int[], int, int, int, edu.rit.util.Searching.Integer)">searchUnsorted</a></strong>(int[] x,
|
|
int off,
|
|
int len,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>int[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(int[], int, edu.rit.util.Searching.Integer)">searchUnsorted</a></strong>(int[] x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>int[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.IntList, int)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a)</code>
|
|
<div class="block">Search the given unordered integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.IntList, int, edu.rit.util.Searching.Integer)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</code>
|
|
<div class="block">Search the given unordered integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(long[], int, int, long)">searchUnsorted</a></strong>(long[] x,
|
|
int off,
|
|
int len,
|
|
long a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>long[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(long[], int, int, long, edu.rit.util.Searching.Long)">searchUnsorted</a></strong>(long[] x,
|
|
int off,
|
|
int len,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>long[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(long[], long)">searchUnsorted</a></strong>(long[] x,
|
|
long a)</code>
|
|
<div class="block">Search the given unordered array of type <TT>long[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(long[], long, edu.rit.util.Searching.Long)">searchUnsorted</a></strong>(long[] x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>long[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.LongList, long)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a)</code>
|
|
<div class="block">Search the given unordered long integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(edu.rit.util.LongList, long, edu.rit.util.Searching.Long)">searchUnsorted</a></strong>(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</code>
|
|
<div class="block">Search the given unordered long integer list for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(short[], int, int, short)">searchUnsorted</a></strong>(short[] x,
|
|
int off,
|
|
int len,
|
|
short a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>short[]</TT>
|
|
for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(short[], int, int, short, edu.rit.util.Searching.Short)">searchUnsorted</a></strong>(short[] x,
|
|
int off,
|
|
int len,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>short[]</TT>
|
|
for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(short[], short)">searchUnsorted</a></strong>(short[] x,
|
|
short a)</code>
|
|
<div class="block">Search the given unordered array of type <TT>short[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(short[], short, edu.rit.util.Searching.Short)">searchUnsorted</a></strong>(short[] x,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>short[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(T[], int, int, T)">searchUnsorted</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(T[], int, int, T, java.util.Comparator)">searchUnsorted</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>T[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(T[], int, int, T, edu.rit.util.Searching.Object)">searchUnsorted</a></strong>(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>T[]</TT> for
|
|
the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> <br>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(T[], T)">searchUnsorted</a></strong>(T[] x,
|
|
T a)</code>
|
|
<div class="block">Search the given unordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(T[], T, java.util.Comparator)">searchUnsorted</a></strong>(T[] x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</code>
|
|
<div class="block">Search the given unordered array of type <TT>T[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static <T> int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Searching.html#searchUnsorted(T[], T, edu.rit.util.Searching.Object)">searchUnsorted</a></strong>(T[] x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</code>
|
|
<div class="block">Search the given unordered array of type <TT>T[]</TT> for the given
|
|
element.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
|
|
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="searchUnsorted(byte[], byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(byte[] x,
|
|
byte a)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>byte[]</TT> for the given
|
|
element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(byte[], int, int, byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>byte[]</TT> for
|
|
the given element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(byte[], byte, edu.rit.util.Searching.Byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(byte[] x,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>byte[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(byte[], int, int, byte, edu.rit.util.Searching.Byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>byte[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(byte[], byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(byte[] x,
|
|
byte a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for the given
|
|
element. It is assumed that the array is sorted in ascending order;
|
|
otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(byte[], int, int, byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
the given element. It is assumed that the array is sorted in ascending
|
|
order; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(byte[], byte, edu.rit.util.Searching.Byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(byte[] x,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(byte[], int, int, byte, edu.rit.util.Searching.Byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for order and equality. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(byte[], byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(byte[] x,
|
|
byte a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for an interval
|
|
containing the given element. It is assumed that the array is sorted in
|
|
ascending order; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(byte[], int, int, byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
an interval containing the given element. It is assumed that the array is
|
|
sorted in ascending order; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(byte[], byte, edu.rit.util.Searching.Byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(byte[] x,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>byte[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(byte[], int, int, byte, edu.rit.util.Searching.Byte)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(byte[] x,
|
|
int off,
|
|
int len,
|
|
byte a,
|
|
<a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util">Searching.Byte</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>byte[]</TT> for
|
|
an interval containing the given element. The given helper object is used
|
|
to compare elements for order and equality. It is assumed that the array
|
|
is sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(char[], char)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(char[] x,
|
|
char a)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>char[]</TT> for the given
|
|
element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(char[], int, int, char)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(char[] x,
|
|
int off,
|
|
int len,
|
|
char a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>char[]</TT> for
|
|
the given element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(char[], char, edu.rit.util.Searching.Character)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(char[] x,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>char[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(char[], int, int, char, edu.rit.util.Searching.Character)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(char[] x,
|
|
int off,
|
|
int len,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>char[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(char[], char)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(char[] x,
|
|
char a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for the given
|
|
element. It is assumed that the array is sorted in ascending order;
|
|
otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(char[], int, int, char)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(char[] x,
|
|
int off,
|
|
int len,
|
|
char a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
the given element. It is assumed that the array is sorted in ascending
|
|
order; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(char[], char, edu.rit.util.Searching.Character)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(char[] x,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(char[], int, int, char, edu.rit.util.Searching.Character)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(char[] x,
|
|
int off,
|
|
int len,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for order and equality. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(char[], char)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(char[] x,
|
|
char a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for an interval
|
|
containing the given element. It is assumed that the array is sorted in
|
|
ascending order; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(char[], int, int, char)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(char[] x,
|
|
int off,
|
|
int len,
|
|
char a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
an interval containing the given element. It is assumed that the array is
|
|
sorted in ascending order; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(char[], char, edu.rit.util.Searching.Character)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(char[] x,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>char[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(char[], int, int, char, edu.rit.util.Searching.Character)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(char[] x,
|
|
int off,
|
|
int len,
|
|
char a,
|
|
<a href="../../../edu/rit/util/Searching.Character.html" title="class in edu.rit.util">Searching.Character</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>char[]</TT> for
|
|
an interval containing the given element. The given helper object is used
|
|
to compare elements for order and equality. It is assumed that the array
|
|
is sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(short[], short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(short[] x,
|
|
short a)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>short[]</TT> for the given
|
|
element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(short[], int, int, short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(short[] x,
|
|
int off,
|
|
int len,
|
|
short a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>short[]</TT>
|
|
for the given element. An <I>O</I>(<I>n</I>) linear search algorithm is
|
|
used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(short[], short, edu.rit.util.Searching.Short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(short[] x,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>short[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(short[], int, int, short, edu.rit.util.Searching.Short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(short[] x,
|
|
int off,
|
|
int len,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>short[]</TT>
|
|
for the given element. The given helper object is used to compare
|
|
elements for equality only. An <I>O</I>(<I>n</I>) linear search algorithm
|
|
is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(short[], short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(short[] x,
|
|
short a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for the given
|
|
element. It is assumed that the array is sorted in ascending order;
|
|
otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(short[], int, int, short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(short[] x,
|
|
int off,
|
|
int len,
|
|
short a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
the given element. It is assumed that the array is sorted in ascending
|
|
order; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(short[], short, edu.rit.util.Searching.Short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(short[] x,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(short[], int, int, short, edu.rit.util.Searching.Short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(short[] x,
|
|
int off,
|
|
int len,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for order and equality. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(short[], short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(short[] x,
|
|
short a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for an interval
|
|
containing the given element. It is assumed that the array is sorted in
|
|
ascending order; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(short[], int, int, short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(short[] x,
|
|
int off,
|
|
int len,
|
|
short a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
an interval containing the given element. It is assumed that the array is
|
|
sorted in ascending order; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(short[], short, edu.rit.util.Searching.Short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(short[] x,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>short[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(short[], int, int, short, edu.rit.util.Searching.Short)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(short[] x,
|
|
int off,
|
|
int len,
|
|
short a,
|
|
<a href="../../../edu/rit/util/Searching.Short.html" title="class in edu.rit.util">Searching.Short</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>short[]</TT> for
|
|
an interval containing the given element. The given helper object is used
|
|
to compare elements for order and equality. It is assumed that the array
|
|
is sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(int[], int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(int[] x,
|
|
int a)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>int[]</TT> for the given
|
|
element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(int[], int, int, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(int[] x,
|
|
int off,
|
|
int len,
|
|
int a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>int[]</TT> for
|
|
the given element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.IntList, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a)</pre>
|
|
<div class="block">Search the given unordered integer list for the given element. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(int[], int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(int[] x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>int[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(int[], int, int, int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(int[] x,
|
|
int off,
|
|
int len,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>int[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.IntList, int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search the given unordered integer list for the given element. The given
|
|
helper object is used to compare elements for equality only. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(int[], int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(int[] x,
|
|
int a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for the given
|
|
element. It is assumed that the array is sorted in ascending order;
|
|
otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(int[], int, int, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(int[] x,
|
|
int off,
|
|
int len,
|
|
int a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
the given element. It is assumed that the array is sorted in ascending
|
|
order; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.IntList, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a)</pre>
|
|
<div class="block">Search the given ordered integer list for the given element. It is
|
|
assumed that the list is sorted in ascending order; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(int[], int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(int[] x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(int[], int, int, int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(int[] x,
|
|
int off,
|
|
int len,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for order and equality. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.IntList, int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search the given ordered integer list for the given element. The given
|
|
helper object is used to compare elements for order and equality. It is
|
|
assumed that the list is sorted in the order determined by the helper
|
|
object; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(int[], int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(int[] x,
|
|
int a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for an interval
|
|
containing the given element. It is assumed that the array is sorted in
|
|
ascending order; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(int[], int, int, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(int[] x,
|
|
int off,
|
|
int len,
|
|
int a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
an interval containing the given element. It is assumed that the array is
|
|
sorted in ascending order; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.IntList, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a)</pre>
|
|
<div class="block">Search the given ordered integer list for an interval containing the
|
|
given element. It is assumed that the list is sorted in ascending order;
|
|
otherwise, the <TT>searchInterval()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(int[], int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(int[] x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>int[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(int[], int, int, int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(int[] x,
|
|
int off,
|
|
int len,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>int[]</TT> for
|
|
an interval containing the given element. The given helper object is used
|
|
to compare elements for order and equality. It is assumed that the array
|
|
is sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.IntList, int, edu.rit.util.Searching.Integer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/IntList.html" title="class in edu.rit.util">IntList</a> x,
|
|
int a,
|
|
<a href="../../../edu/rit/util/Searching.Integer.html" title="class in edu.rit.util">Searching.Integer</a> helper)</pre>
|
|
<div class="block">Search the given ordered integer list for an interval containing the
|
|
given element. The given helper object is used to compare elements for
|
|
order and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(long[], long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(long[] x,
|
|
long a)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>long[]</TT> for the given
|
|
element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(long[], int, int, long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(long[] x,
|
|
int off,
|
|
int len,
|
|
long a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>long[]</TT> for
|
|
the given element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.LongList, long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a)</pre>
|
|
<div class="block">Search the given unordered long integer list for the given element. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(long[], long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(long[] x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>long[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(long[], int, int, long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(long[] x,
|
|
int off,
|
|
int len,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>long[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.LongList, long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search the given unordered long integer list for the given element. The
|
|
given helper object is used to compare elements for equality only. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(long[], long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(long[] x,
|
|
long a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for the given
|
|
element. It is assumed that the array is sorted in ascending order;
|
|
otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(long[], int, int, long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(long[] x,
|
|
int off,
|
|
int len,
|
|
long a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
the given element. It is assumed that the array is sorted in ascending
|
|
order; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.LongList, long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a)</pre>
|
|
<div class="block">Search the given ordered long integer list for the given element. It is
|
|
assumed that the list is sorted in ascending order; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(long[], long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(long[] x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(long[], int, int, long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(long[] x,
|
|
int off,
|
|
int len,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for order and equality. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.LongList, long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search the given ordered long integer list for the given element. The
|
|
given helper object is used to compare elements for order and equality.
|
|
It is assumed that the list is sorted in the order determined by the
|
|
helper object; otherwise, the <TT>searchSorted()</TT> method's behavior
|
|
is not specified. An <I>O</I>(log <I>n</I>) binary search algorithm is
|
|
used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(long[], long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(long[] x,
|
|
long a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for an interval
|
|
containing the given element. It is assumed that the array is sorted in
|
|
ascending order; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(long[], int, int, long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(long[] x,
|
|
int off,
|
|
int len,
|
|
long a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
an interval containing the given element. It is assumed that the array is
|
|
sorted in ascending order; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.LongList, long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a)</pre>
|
|
<div class="block">Search the given ordered long integer list for an interval containing the
|
|
given element. It is assumed that the list is sorted in ascending order;
|
|
otherwise, the <TT>searchInterval()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(long[], long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(long[] x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>long[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(long[], int, int, long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(long[] x,
|
|
int off,
|
|
int len,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>long[]</TT> for
|
|
an interval containing the given element. The given helper object is used
|
|
to compare elements for order and equality. It is assumed that the array
|
|
is sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.LongList, long, edu.rit.util.Searching.Long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/LongList.html" title="class in edu.rit.util">LongList</a> x,
|
|
long a,
|
|
<a href="../../../edu/rit/util/Searching.Long.html" title="class in edu.rit.util">Searching.Long</a> helper)</pre>
|
|
<div class="block">Search the given ordered long integer list for an interval containing the
|
|
given element. The given helper object is used to compare elements for
|
|
order and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(float[], float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(float[] x,
|
|
float a)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>float[]</TT> for the given
|
|
element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(float[], int, int, float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(float[] x,
|
|
int off,
|
|
int len,
|
|
float a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>float[]</TT>
|
|
for the given element. An <I>O</I>(<I>n</I>) linear search algorithm is
|
|
used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.FloatList, float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a)</pre>
|
|
<div class="block">Search the given unordered float list for the given element. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(float[], float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(float[] x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>float[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(float[], int, int, float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(float[] x,
|
|
int off,
|
|
int len,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>float[]</TT>
|
|
for the given element. The given helper object is used to compare
|
|
elements for equality only. An <I>O</I>(<I>n</I>) linear search algorithm
|
|
is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.FloatList, float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search the given unordered float list for the given element. The given
|
|
helper object is used to compare elements for equality only. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(float[], float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(float[] x,
|
|
float a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for the given
|
|
element. It is assumed that the array is sorted in ascending order;
|
|
otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(float[], int, int, float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(float[] x,
|
|
int off,
|
|
int len,
|
|
float a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
the given element. It is assumed that the array is sorted in ascending
|
|
order; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.FloatList, float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a)</pre>
|
|
<div class="block">Search the given ordered float list for the given element. It is assumed
|
|
that the list is sorted in ascending order; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(float[], float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(float[] x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(float[], int, int, float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(float[] x,
|
|
int off,
|
|
int len,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for order and equality. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.FloatList, float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search the given ordered float list for the given element. The given
|
|
helper object is used to compare elements for order and equality. It is
|
|
assumed that the list is sorted in the order determined by the helper
|
|
object; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(float[], float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(float[] x,
|
|
float a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for an interval
|
|
containing the given element. It is assumed that the array is sorted in
|
|
ascending order; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(float[], int, int, float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(float[] x,
|
|
int off,
|
|
int len,
|
|
float a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
an interval containing the given element. It is assumed that the array is
|
|
sorted in ascending order; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.FloatList, float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a)</pre>
|
|
<div class="block">Search the given ordered float list for an interval containing the
|
|
given element. It is assumed that the list is sorted in ascending order;
|
|
otherwise, the <TT>searchInterval()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(float[], float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(float[] x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>float[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(float[], int, int, float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(float[] x,
|
|
int off,
|
|
int len,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>float[]</TT> for
|
|
an interval containing the given element. The given helper object is used
|
|
to compare elements for order and equality. It is assumed that the array
|
|
is sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.FloatList, float, edu.rit.util.Searching.Float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/FloatList.html" title="class in edu.rit.util">FloatList</a> x,
|
|
float a,
|
|
<a href="../../../edu/rit/util/Searching.Float.html" title="class in edu.rit.util">Searching.Float</a> helper)</pre>
|
|
<div class="block">Search the given ordered float list for an interval containing the
|
|
given element. The given helper object is used to compare elements for
|
|
order and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(double[], double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(double[] x,
|
|
double a)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>double[]</TT> for the given
|
|
element. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(double[], int, int, double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(double[] x,
|
|
int off,
|
|
int len,
|
|
double a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>double[]</TT>
|
|
for the given element. An <I>O</I>(<I>n</I>) linear search algorithm is
|
|
used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.DoubleList, double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a)</pre>
|
|
<div class="block">Search the given unordered double list for the given element. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(double[], double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(double[] x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>double[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(double[], int, int, double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(double[] x,
|
|
int off,
|
|
int len,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>double[]</TT>
|
|
for the given element. The given helper object is used to compare
|
|
elements for equality only. An <I>O</I>(<I>n</I>) linear search algorithm
|
|
is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.DoubleList, double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static int searchUnsorted(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search the given unordered double list for the given element. The given
|
|
helper object is used to compare elements for equality only. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(double[], double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(double[] x,
|
|
double a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for the given
|
|
element. It is assumed that the array is sorted in ascending order;
|
|
otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(double[], int, int, double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(double[] x,
|
|
int off,
|
|
int len,
|
|
double a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
the given element. It is assumed that the array is sorted in ascending
|
|
order; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.DoubleList, double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a)</pre>
|
|
<div class="block">Search the given ordered double list for the given element. It is
|
|
assumed that the list is sorted in ascending order; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(double[], double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(double[] x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(double[], int, int, double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(double[] x,
|
|
int off,
|
|
int len,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for order and equality. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.DoubleList, double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static int searchSorted(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search the given ordered double list for the given element. The given
|
|
helper object is used to compare elements for order and equality. It is
|
|
assumed that the list is sorted in the order determined by the helper
|
|
object; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(double[], double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(double[] x,
|
|
double a)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for an interval
|
|
containing the given element. It is assumed that the array is sorted in
|
|
ascending order; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(double[], int, int, double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(double[] x,
|
|
int off,
|
|
int len,
|
|
double a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
an interval containing the given element. It is assumed that the array is
|
|
sorted in ascending order; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.DoubleList, double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a)</pre>
|
|
<div class="block">Search the given ordered double list for an interval containing the
|
|
given element. It is assumed that the list is sorted in ascending order;
|
|
otherwise, the <TT>searchInterval()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(double[], double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(double[] x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>double[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(double[], int, int, double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(double[] x,
|
|
int off,
|
|
int len,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>double[]</TT> for
|
|
an interval containing the given element. The given helper object is used
|
|
to compare elements for order and equality. It is assumed that the array
|
|
is sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.DoubleList, double, edu.rit.util.Searching.Double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static int searchInterval(<a href="../../../edu/rit/util/DoubleList.html" title="class in edu.rit.util">DoubleList</a> x,
|
|
double a,
|
|
<a href="../../../edu/rit/util/Searching.Double.html" title="class in edu.rit.util">Searching.Double</a> helper)</pre>
|
|
<div class="block">Search the given ordered double list for an interval containing the
|
|
given element. The given helper object is used to compare elements for
|
|
order and equality. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(java.lang.Comparable[],java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(T[], T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchUnsorted(T[] x,
|
|
T a)</pre>
|
|
<div class="block">Search the given unordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given element. The element's
|
|
<TT>compareTo()</TT> method is used to compare elements for equality
|
|
only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(java.lang.Comparable[],int,int,java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(T[], int, int, T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchUnsorted(T[] x,
|
|
int off,
|
|
int len,
|
|
T a)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given
|
|
element. The element's <TT>compareTo()</TT> method is used to compare
|
|
elements for equality only. An <I>O</I>(<I>n</I>) linear search algorithm
|
|
is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.AList,java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(edu.rit.util.AList, T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchUnsorted(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a)</pre>
|
|
<div class="block">Search the given unordered comparable object list for the given element.
|
|
The element's <TT>compareTo()</TT> method is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>,
|
|
then the index of that element is returned. Otherwise, −1
|
|
is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(java.lang.Object[],java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(T[], T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T> int searchUnsorted(T[] x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>T[]</TT> for the given
|
|
element. The given helper object is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(java.lang.Object[],int,int,java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(T[], int, int, T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T> int searchUnsorted(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>T[]</TT> for
|
|
the given element. The given helper object is used to compare elements
|
|
for equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.AList,java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(edu.rit.util.AList, T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T> int searchUnsorted(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search the given unordered object list for the given element. The given
|
|
helper object is used to compare elements for equality only. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(java.lang.Object[],java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(T[], T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T> int searchUnsorted(T[] x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search the given unordered array of type <TT>T[]</TT> for the given
|
|
element. The given comparator is used to compare elements for equality
|
|
only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(java.lang.Object[],int,int,java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(T[], int, int, T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T> int searchUnsorted(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search a portion of the given unordered array of type <TT>T[]</TT> for
|
|
the given element. The given comparator is used to compare elements for
|
|
equality only. An <I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchUnsorted(edu.rit.util.AList,java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchUnsorted(edu.rit.util.AList, T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchUnsorted</h4>
|
|
<pre>public static <T> int searchUnsorted(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search the given unordered object list for the given element. The given
|
|
comparator is used to compare elements for equality only. An
|
|
<I>O</I>(<I>n</I>) linear search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(java.lang.Comparable[],java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(T[], T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchSorted(T[] x,
|
|
T a)</pre>
|
|
<div class="block">Search the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given element. The element's
|
|
<TT>compareTo()</TT> method is used to compare elements for equality and
|
|
ordering. It is assumed that the array is sorted in the order determined
|
|
by the element's <TT>compareTo()</TT> method; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(java.lang.Comparable[],int,int,java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(T[], int, int, T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchSorted(T[] x,
|
|
int off,
|
|
int len,
|
|
T a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for the given
|
|
element. The element's <TT>compareTo()</TT> method is used to compare
|
|
elements for equality and ordering. It is assumed that the array is
|
|
sorted in the order determined by the element's <TT>compareTo()</TT>
|
|
method; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is
|
|
used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.AList,java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(edu.rit.util.AList, T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchSorted(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a)</pre>
|
|
<div class="block">Search the given ordered comparable object list for the given element.
|
|
The element's <TT>compareTo()</TT> method is used to compare elements for
|
|
equality and ordering. It is assumed that the list is sorted in the order
|
|
determined by the element's <TT>compareTo()</TT> method; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(java.lang.Object[],java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(T[], T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T> int searchSorted(T[] x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for the given
|
|
element. The given helper object is used to compare elements for equality
|
|
and ordering. It is assumed that the array is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(java.lang.Object[],int,int,java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(T[], int, int, T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T> int searchSorted(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for the
|
|
given element. The given helper object is used to compare elements for
|
|
equality and ordering. It is assumed that the array is sorted in the
|
|
order determined by the helper object; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.AList,java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(edu.rit.util.AList, T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T> int searchSorted(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search the given ordered object list for the given element. The given
|
|
helper object is used to compare elements for equality and ordering. It
|
|
is assumed that the list is sorted in the order determined by the helper
|
|
object; otherwise, the <TT>searchSorted()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is
|
|
used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(java.lang.Object[],java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(T[], T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T> int searchSorted(T[] x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for the given
|
|
element. The given comparator is used to compare elements for equality
|
|
and ordering. It is assumed that the array is sorted in the order
|
|
determined by the comparator; otherwise, the <TT>searchSorted()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(java.lang.Object[],int,int,java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(T[], int, int, T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T> int searchSorted(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for the
|
|
given element. The given comparator is used to compare elements for
|
|
equality and ordering. It is assumed that the array is sorted in the
|
|
order determined by the comparator; otherwise, the
|
|
<TT>searchSorted()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x[off]</TT>
|
|
through <TT>x[off+len-1]</TT>, then the index of that element is
|
|
returned. Otherwise, −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchSorted(edu.rit.util.AList,java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchSorted(edu.rit.util.AList, T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchSorted</h4>
|
|
<pre>public static <T> int searchSorted(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search the given ordered object list for the given element. The given
|
|
comparator is used to compare elements for equality and ordering. It is
|
|
assumed that the list is sorted in the order determined by the
|
|
comparator; otherwise, the <TT>searchSorted()</TT> method's behavior is
|
|
not specified. An <I>O</I>(log <I>n</I>) binary search algorithm is
|
|
used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>If an element the same as <TT>a</TT> exists in <TT>x</TT>, then
|
|
the index of that element is returned. Otherwise, −1 is
|
|
returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(java.lang.Comparable[],java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(T[], T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchInterval(T[] x,
|
|
T a)</pre>
|
|
<div class="block">Search the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for an interval containing the given
|
|
element. The element's <TT>compareTo()</TT> method is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the element's <TT>compareTo()</TT> method;
|
|
otherwise, the <TT>searchInterval()</TT> method's behavior is not
|
|
specified. An <I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(java.lang.Comparable[],int,int,java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(T[], int, int, T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchInterval(T[] x,
|
|
int off,
|
|
int len,
|
|
T a)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><TT><T>[]</TT> for an interval
|
|
containing the given element. The element's <TT>compareTo()</TT> method
|
|
is used to compare elements for order and equality. It is assumed that
|
|
the array is sorted in the order determined by the element's
|
|
<TT>compareTo()</TT> method; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.AList,java.lang.Comparable)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(edu.rit.util.AList, T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>> int searchInterval(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a)</pre>
|
|
<div class="block">Search the given ordered comparable object list for an interval
|
|
containing the given element. The element's <TT>compareTo()</TT> method
|
|
is used to compare elements for order and equality. It is assumed that
|
|
the list is sorted in the order determined by the element's
|
|
<TT>compareTo()</TT> method; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(java.lang.Object[],java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(T[], T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T> int searchInterval(T[] x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for an interval
|
|
containing the given element. The given helper object is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(java.lang.Object[],int,int,java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(T[], int, int, T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T> int searchInterval(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for an
|
|
interval containing the given element. The given helper object is used to
|
|
compare elements for order and equality. It is assumed that the array is
|
|
sorted in the order determined by the helper object; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.AList,java.lang.Object,edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(edu.rit.util.AList, T, edu.rit.util.Searching.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T> int searchInterval(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="../../../edu/rit/util/Searching.Object.html" title="class in edu.rit.util">Searching.Object</a><T> helper)</pre>
|
|
<div class="block">Search the given ordered object list for an interval containing the given
|
|
element. The given helper object is used to compare elements for order
|
|
and equality. It is assumed that the list is sorted in the order
|
|
determined by the helper object; otherwise, the <TT>searchInterval()</TT>
|
|
method's behavior is not specified. An <I>O</I>(log <I>n</I>) binary
|
|
search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>helper</code> - Helper object.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(java.lang.Object[],java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(T[], T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T> int searchInterval(T[] x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search the given ordered array of type <TT>T[]</TT> for an interval
|
|
containing the given element. The given comparator is used to compare
|
|
elements for order and equality. It is assumed that the array is sorted
|
|
in the order determined by the comparator; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[0]</TT>, then <TT>i</TT> = 0
|
|
is returned. If <TT>x[x.length-1]</TT> ≤ <TT>a</TT>, then
|
|
<TT>i</TT> = <TT>x.length</TT> is returned. If <TT>x</TT> is zero
|
|
length, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(java.lang.Object[],int,int,java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(T[], int, int, T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T> int searchInterval(T[] x,
|
|
int off,
|
|
int len,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search a portion of the given ordered array of type <TT>T[]</TT> for an
|
|
interval containing the given element. The given comparator is used to
|
|
compare elements for order and equality. It is assumed that the array is
|
|
sorted in the order determined by the comparator; otherwise, the
|
|
<TT>searchInterval()</TT> method's behavior is not specified. An
|
|
<I>O</I>(log <I>n</I>) binary search algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Array element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Array to be searched.</dd><dd><code>off</code> - Index of first element to be searched.</dd><dd><code>len</code> - Number of elements to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x[i-1]</TT> ≤ <TT>a</TT> <
|
|
<TT>x[i]</TT>. If <TT>a</TT> < <TT>x[off]</TT>, then <TT>i</TT> =
|
|
<TT>off</TT> is returned. If <TT>x[off+len-1]</TT> ≤ <TT>a</TT>,
|
|
then <TT>i</TT> = <TT>off+len</TT> is returned. If <TT>len</TT> = 0,
|
|
then <TT>i</TT> = −1 is returned.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off+len</TT> > <TT>x.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="searchInterval(edu.rit.util.AList,java.lang.Object,java.util.Comparator)">
|
|
<!-- -->
|
|
</a><a name="searchInterval(edu.rit.util.AList, T, java.util.Comparator)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>searchInterval</h4>
|
|
<pre>public static <T> int searchInterval(<a href="../../../edu/rit/util/AList.html" title="class in edu.rit.util">AList</a><T> x,
|
|
T a,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a><T> comp)</pre>
|
|
<div class="block">Search the given ordered object list for an interval containing the given
|
|
element. The given comparator is used to compare elements for order and
|
|
equality. It is assumed that the list is sorted in the order determined
|
|
by the comparator; otherwise, the <TT>searchInterval()</TT> method's
|
|
behavior is not specified. An <I>O</I>(log <I>n</I>) binary search
|
|
algorithm is used.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - List element data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - List to be searched.</dd><dd><code>a</code> - Element to be searched for.</dd><dd><code>comp</code> - Comparator.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>An index <TT>i</TT> such that <TT>x.get(i-1)</TT> ≤ <TT>a</TT>
|
|
< <TT>x.get(i)</TT>. If <TT>a</TT> < <TT>x.get(0)</TT>, then
|
|
<TT>i</TT> = 0 is returned. If <TT>x.get(x.size()-1)</TT> ≤
|
|
<TT>a</TT>, then <TT>i</TT> = <TT>x.size()</TT> is returned. If
|
|
<TT>x</TT> is empty, then <TT>i</TT> = −1 is returned.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a name="navbar_bottom">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/Searching.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../edu/rit/util/RandomSubset.html" title="class in edu.rit.util"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/util/Searching.Byte.html" title="class in edu.rit.util"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?edu/rit/util/Searching.html" target="_top">Frames</a></li>
|
|
<li><a href="Searching.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li><a href="#nested_class_summary">Nested</a> | </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
<p class="legalCopy"><small><FONT SIZE="-2">Copyright © 2013–2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">@</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
|
|
</body>
|
|
</html>
|