0% found this document useful (0 votes)
14 views

Assignment-1_Java

The document outlines a programming assignment that includes several tasks related to array manipulation, such as initializing an array, finding maximum and minimum values, reversing the array, rotating it by 'k' steps, counting element frequencies, and finding the second largest element. Additionally, it covers checking if an array is sorted, implementing linear and binary search algorithms, and sorting using bubble and selection sort while comparing their performance. The assignment is due on February 5, 2025.

Uploaded by

mr0unknown666
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Assignment-1_Java

The document outlines a programming assignment that includes several tasks related to array manipulation, such as initializing an array, finding maximum and minimum values, reversing the array, rotating it by 'k' steps, counting element frequencies, and finding the second largest element. Additionally, it covers checking if an array is sorted, implementing linear and binary search algorithms, and sorting using bubble and selection sort while comparing their performance. The assignment is due on February 5, 2025.

Uploaded by

mr0unknown666
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment : 1

Submission : 5 Feb 2025

Initialize an Array and Take Input:

Write a program to initialize an array of integers, take user input to fill the
array, and then print the array.
Find Maximum and Minimum in an Array:

Given an array of integers, write a program to find the maximum and minimum values
in the array.
Reverse the Array:

Write a function that reverses an array without using any additional array.
Rotate Array by k Steps:

Write a program to rotate an array of integers by 'k' steps to the right.


Count Frequency of Each Element in an Array:

Write a program to count the frequency of each element in a given array.


Find the Second Largest Element in an Array:

Given an array of integers, find the second largest element without sorting the
array.
Check if the Array is Sorted:

Write a program to check if a given array is sorted in ascending order.


Searching and Sorting:
Linear Search and Binary Search:

Implement both Linear Search and Binary Search algorithms to find an element in a
sorted array and unsorted array respectively.
Bubble Sort and Selection Sort:

Write a program to sort an array using Bubble Sort and Selection Sort, and compare
their performance.
Find First and Last Occurrence of a Number in a Sorted Array:

Given a sorted array, find the first and last occurrence of a specific number.

You might also like