59 solutions available
Question 1Write a program to initialise the given data in an array and find the minimum and maximum values along with the sum of the given...
Question 2Differentiate between the following.i. Array Declaration and Initialisation
Question 3How does the linear search find an element in the array? Explain your answer with a suitable example.
Question 4Explain the technique of Bubble Sort with an example.
Question 5Explain the technique of Selection Sort with an example.
Question 6Why does Binary Search need a sorted array to perform the search operation?
Question 7How is one-dimensional array represented in memory ?
Question 8Write a program to input integer elements into an array of size 20 and perform the following operations:Display largest number from the...
Question 10Suppose x is an array of type int[] with 50 elements. Write a code segment that will count and print the frequency of number 42 in the...
Question 12Write a code segment to compute the sum of all positive real numbers stored in the following array.double numb[] = new double[50];
Question 13Write a code segment that finds the largest integer in this two-dimensional array.int data[][] = new int[5][5];
Question 14Given the following declarations:final int SIZE = 20; char[] name = new char[SIZE];i. Write an assignment statement that stores 'D' into...
Question 14(ii)Declare following arrays: check of 100 short element.
Question 16Write Java statements for the following:i. Create an array to hold 15 double values.ii. Assign the value 10.5 to the last element in the...
Question 17Write a program to accept the year of graduation from school as an integer value from the user. Using the binary search technique on the...
Question 18Write a program that reads ten integers and displays them in the reverse order in which they were read.
Question 19Write a program that reads a long number, counts and displays the occurrences of each digit in it.
Question 20Write a program to input 10 integer elements in an array and sort them in descending order using bubble sort technique.
Question 21Write a program to perform binary search on a list of integers given below, to search for an element input by the user. If it is found...
Question 22Write a program to store 6 elements in an array P and 4 elements in an array Q. Now, produce a third array R, containing all the elements...
Question 23The annual examination result of 50 students in a class is tabulated in a Single Dimensional Array (SDA) as follows:Roll No.Subject...
Question 24Declare a single dimensional array of size 28 to store daily temperatures for the month of February. Using this structure, write a program...
Question 25Repeat the above exercise using a double two-dimensional array with 4 rows and 7 columns to store daily temperatures for the month of...
Question 26The weekly hours of all employees of ABC Consulting Ltd. are stored in a two-dimensional array. Each row records an employee's 7-day work...
Question 27Write a program that computes the standard deviation of N real numbers. The standard deviation s is computed according...
Question 22Name some commonly used sorting techniques.
Question 23Show the contents of the array after the second iteration of Selection...
Question 24Show the contents of the array after the second iteration of Bubble...
Question 25What is the difference between linear search and binary search ?
Question 26Given the following array...
Question 27Given the following array...
Question 28What is an array ? What is the need for arrays ?
Question 29What are different types of arrays? Give examples of each array type.
Question 30Write a note on how single-dimension arrays are represented in memory.
Question 31How does the amount of storage (in bytes) depend upon type and size of an array? Explain with the help of an example.
Question 32What do you understand by two-dimensional arrays ? State some situations that can be easily represented by two-dimensional arrays.
Question 33How are two-dimensional arrays represented in memory ?
Question 34Suppose A, B, C are arrays of integers of sizes m, n, m + n respectively. Give a program to produce a third array C, containing all the...
Question 35Write a short program that doubles every element of an array A[4][4].import java.util.Scanner; public class KboatDDADouble { public...
Question 36Let A(n x n) that are not diagonal array. Write a program to find the sum of all the elements which lie on either diagonal. For example,...
Question 37From a two-dimensional array A[4][4], write a program to prepare a one-dimensional array B[16] that will have all the elements of A if...
Question 38Write a function that checks whether or not two arrays (of characters) are identical, that is, whether they have same characters and all...
Question 39The marks obtained by 50 students in a subject are tabulated as follows :NameMarks......Write a program to input the names and marks of...
Question 40Differentiate between one-dimensional and two-dimensional arrays.
Question 41Explain(i) Linear search method,(ii) Binary search method.Which of the two is more efficient for sorted data ?
Question 42Write a program Lower-left-half which takes a two dimensional array A, with size N rows and N columns as argument and prints the lower...
Question 43Write a program to search for an ITEM linearly in array X[10].
Question 44Write a program to search for an ITEM using binary search in array X[10].import java.util.Scanner; public class KboatBinarySearch {...
Question 45The following array of integers is to be arranged in ascending order using the bubble sort technique:26 21 20 23 29 17Give the contents of...
Question 46Write a program to search for a given ITEM in a given array X[n] using linear search technique. If the ITEM is found, move it at the top...
Question 47Write a program to search for 66 and 71 in the following array...
Question 48Given the following array...
Question 49For the same array mentioned above in previous question, write a program to sort the above array using bubble sort technique. Give the...
Question 50Write a program to input integer elements into an array of size 20 and perform the following operations :(i) Display largest number from...
Question 51Write a program to input forty words in an array. Arrange these words in descending order of alphabets, using selection sort technique....
Question 52Write a program that reads a 4 x 5 two dimensional array and then prints the column sums of the array along with the array printed in...
Question 53Write a program that inputs a 2D array and displays how the array elements will look in row major form and column major form.import...
Question 9Given that int z[ ][ ] = {{2, 6, 5}, {8, 3, 9}}; What will be value of z[1][0] and z[0][2] ?2 and 98 and 52 and 56 and 3
Question 11Given an array 12, 3, 8, 5. What will be array like after two passes of bubble sort?12, 3, 8, 53, 8, 12, 53, 5, 8, 1212, 3, 5, 8