<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>array programs in java - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/array-programs-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/array-programs-in-java/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Tue, 14 Sep 2021 05:26:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>array programs in java - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/array-programs-in-java/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to optimally divide an array into two subarrays so that sum of elements in both are same ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:02 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[2d array java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[addition program in java]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[array declaration]]></category>
		<category><![CDATA[array declaration in java]]></category>
		<category><![CDATA[array of objects in java]]></category>
		<category><![CDATA[array programs in java]]></category>
		<category><![CDATA[arraylist java]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[for each loop java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java 8 reduce]]></category>
		<category><![CDATA[java add to array]]></category>
		<category><![CDATA[java array]]></category>
		<category><![CDATA[java array class]]></category>
		<category><![CDATA[java array example]]></category>
		<category><![CDATA[java array length]]></category>
		<category><![CDATA[java array methods]]></category>
		<category><![CDATA[java foreach array]]></category>
		<category><![CDATA[java initialize array]]></category>
		<category><![CDATA[java print array]]></category>
		<category><![CDATA[java sort array]]></category>
		<category><![CDATA[java stream sum]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[remaxys infotech interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[split array where sum of left hand side is equal to sum of right hand side]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=663</guid>

					<description><![CDATA[Answer : Given an array of integers greater than zero...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same" class="color-pink" style="text-align: justify;">How to optimally divide an array into two subarrays so that sum of elements in both are same ?</h2>
<p style="text-align: justify;">There are two methods used to <a href="https://www.wikitechy.com/tutorials/java/how-to-split-string-into-array-in-java" target="_blank" rel="noopener">split arrays</a>,</p>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Given an array of integers greater than zero, find if it is possible to split it in two subarrays (without reordering the elements), such that the sum of the two subarrays is the same. For example,</li>
</ul>
</div>
</div>
<div class="Output" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs" data-lang=""><span class="nt">Input : Arr[] = { 1 , 2 , 3 , 4 , 5 , 5  }
Output :  { 1 2 3 4 } 
          { 5 , 5 }
</span></code></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Given an array of integers, find if it’s possible to remove exactly one integer from the array that divides the array into two subarrays with the same sum. For Example,</li>
</ul>
</div>
</div>
<div class="Output" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs bash" data-lang=""><span class="nt">                           Input:  arr = [<span class="hljs-number">6</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">2</span>, <span class="hljs-number">1</span>]
                           Output:  <span class="hljs-literal">true</span>
</span></code></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>On removing element 2 at index 1, the array gets divided into two subarrays [6] and [3, 2, 1] having equal sum.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"></div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-blue" style="text-align: justify;">Sample Code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">/ Java program to split an array <br/>// into two equal sum subarrays <br/>import java.io.*;<br/><br/>class Wikitechy {<br/><br/>    // Returns split point. If <br/>    // not possible, then return -1. <br/>    static int findSplitPoint(int arr[], int n) {<br/><br/>        int leftSum = 0;<br/><br/>        // traverse array element <br/>        for (int i = 0; i < n; i++) {<br/>            // add current element to left Sum <br/>            leftSum += arr[i];<br/><br/>            // find sum of rest array <br/>            // elements (rightSum) <br/>            int rightSum = 0;<br/><br/>            for (int j = i + 1; j < n; j++)<br/>                rightSum += arr[j];<br/><br/>            // split point index <br/>            if (leftSum == rightSum)<br/>                return i + 1;<br/>        }<br/><br/>        // if it is not possible to <br/>        // split array into two parts <br/>        return -1;<br/>    }<br/><br/>    // Prints two parts after finding <br/>    // split point using findSplitPoint() <br/>    static void printTwoParts(int arr[], int n) {<br/><br/>        int splitPoint = findSplitPoint(arr, n);<br/><br/>        if (splitPoint == -1 || splitPoint == n) {<br/>            System.out.println(&quot;Not Possible&quot;);<br/>            return;<br/>        }<br/><br/>        for (int i = 0; i < n; i++) {<br/>            if (splitPoint == i)<br/>                System.out.println();<br/><br/>            System.out.print(arr[i] + &quot; &quot;);<br/><br/>        }<br/>    }<br/><br/>    // Driver program <br/><br/>    public static void main(String[] args) {<br/><br/>        int arr[] = {1,1,0,2};<br/>        int n = arr.length;<br/>        printTwoParts(arr, n);<br/><br/>    }<br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs" data-lang=""><span class="nt">1 1 
0 2</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Write a function that takes an integer array as an input and find the largest number in the array. You cannot sort array or use any API or searching needs ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/write-a-function-that-takes-an-integer-array-as-an-input-and-find-the-largest-number-in-the-array-you-cannot-sort-array-or-use-any-api-or-searching-needs/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/write-a-function-that-takes-an-integer-array-as-an-input-and-find-the-largest-number-in-the-array-you-cannot-sort-array-or-use-any-api-or-searching-needs/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 22:02:37 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[2d array c++]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[algorithm to find largest number in an array]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[array find]]></category>
		<category><![CDATA[array in c]]></category>
		<category><![CDATA[array in c programming]]></category>
		<category><![CDATA[array programs in java]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[c interview questions]]></category>
		<category><![CDATA[c program to find largest number in an array]]></category>
		<category><![CDATA[c program to find largest number in an array using function]]></category>
		<category><![CDATA[c program to find largest of n numbers]]></category>
		<category><![CDATA[c++ array class]]></category>
		<category><![CDATA[c++ array functions]]></category>
		<category><![CDATA[c++ program to find largest and second largest number in an array]]></category>
		<category><![CDATA[c++ program to find largest and smallest number in an array]]></category>
		<category><![CDATA[c++ program to find largest of n numbersdynamic array c++]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[cpp interview questions]]></category>
		<category><![CDATA[cpp interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[eInfochips interview questions and answers]]></category>
		<category><![CDATA[Electronics Arts Inc interview questions and answers]]></category>
		<category><![CDATA[find largest number in an array]]></category>
		<category><![CDATA[find largest number in array]]></category>
		<category><![CDATA[find largest number in array c++]]></category>
		<category><![CDATA[find largest number in array in java]]></category>
		<category><![CDATA[find largest number in array java]]></category>
		<category><![CDATA[find largest number in array javascript]]></category>
		<category><![CDATA[find largest number in java]]></category>
		<category><![CDATA[find second largest number in array in java]]></category>
		<category><![CDATA[find smallest number in array c++]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Harman International interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[java find largest number in list]]></category>
		<category><![CDATA[largest number formed from an array in clength of array c++]]></category>
		<category><![CDATA[Larsen & Toubro interview questions and answers]]></category>
		<category><![CDATA[Mathworks India Private Limited interview questions and answers]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Philips Software Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[program to find largest number in an array]]></category>
		<category><![CDATA[return array c++string array c++]]></category>
		<category><![CDATA[SRM Technologies interview questions and answers]]></category>
		<category><![CDATA[Symphony Teleca interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tecnotree interview questions and answers]]></category>
		<category><![CDATA[two dimensional array in c++ example]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<category><![CDATA[Yash Technologies interview questions and answers]]></category>
		<category><![CDATA[zycus infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=358</guid>

					<description><![CDATA[Answer : #include<iostream>...]]></description>
										<content:encoded><![CDATA[<h4 id="write-a-function-that-takes-an-integer-array-as-an-input-and-find-the-largest-number-in-the-array-you-cannot-sort-array-or-use-any-api-or-searching-needs" class="color-pink" style="text-align: justify;">Write a function that takes an integer array as an input and find the largest number in the array. You cannot sort array or use any API or searching needs ?</h4>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-cpp code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-cpp code-embed-code">#include<iostream><br/>using namespace std;<br/><br/>int main()<br/>{<br/>int name[5],big,i;<br/><br/>for(i=0; i<=4; i++) {<br/>cout << &quot;Enter a value&quot; << i << &quot;:&quot;;<br/>cin >> name[i];<br/>}<br/>cout << &quot;name contains:&quot;;<br/>for(i=0; i<=4; i++) {<br/>cout << name[i]<< &quot;\n&quot;;<br/>}<br/><br/>big = name[0];<br/>for(i = 0; i <= 4; i++) {<br/>if(name[i] > big)<br/>big = name[i];<br/>}<br/><br/>cout << &quot;The Bigest Number::&quot; << big << endl;<br/><br/>return 0;<br/>}</code></pre> </div>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/write-a-function-that-takes-an-integer-array-as-an-input-and-find-the-largest-number-in-the-array-you-cannot-sort-array-or-use-any-api-or-searching-needs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
