0% found this document useful (0 votes)
12 views10 pages

D.Y.Patiltechnicalcampus, Talsande Faculty of Engineering & Faculty Ofmanagement (Polytechnic)

Uploaded by

fdj5045
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views10 pages

D.Y.Patiltechnicalcampus, Talsande Faculty of Engineering & Faculty Ofmanagement (Polytechnic)

Uploaded by

fdj5045
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

D.Y.

PATILTECHNICALCAMPUS, TALSANDE
FACULTY OF ENGINEERING & FACULTY
OFMANAGEMENT
(Polytechnic)

A Microproject Report On
“Report on ALP to sum of smallest
number in Array”

Submitted By
EnrollementNo Name Of Student
2112200050 Aditya Uttam Patil

2112200051 Sanskar mandar Kulkarni

2112200052 Atharv Manohar Nale

Guided By
Miss.GuravJ.N.
D.Y.PATILTECHNICALCAMPUS,TALSANDEFACULTYOFENG
INEERING & FACULTYOFMANAGEMENT
(Polytechnic)
DEPARTMENT OF COMPUTER
ENGINEERINGSEMESTER IV
CERTIFICATE

This is Certificate that student of Computer Engineering has successfully completed


the project term work “Report on ALP to sum of smallest number in Array” Impartial
fulfillment of the Diploma of Engineering in Computer as laid down during
academicyear2022-23.

RollNo Name Of Student Exam Seat No


2237 Aditya Uttam Patil 244897

2238 Sanskar Mandar Kulkarni

2239 Atharv Manohar nale

Miss.Gurav.J.N. Mr.R.S. Kumbhar


R.S.Project Guide HoD

Dr.S.R.Pawaskar
Principal

Date- / /2023
Place-Talsande
Index

SR.NO Title Page No.

1. information 1-2

2. Advantages and 3
Disadvantages

3. Application 4

4. Code 5

5. Conclusion 6

6. Result 7
Report on ALP to sum of smallest number in Array

What is Array: -
An array is a collection of similar data elements stored at contiguous memory locations. It is
the simplest data structure where each data element can be accessed directly by only using its
index number.

For instance, if we want to store the marks scored by a student in 5 subjects, then there’s no
need to define individual variables for each subject. Rather, we can define an array that will
store the data elements at contiguous memory locations.

Array marks [5] define the marks scored by a student in 5 different subjects where each
subject’s marks are located at a particular location in the array, i.e., marks [0] denote the marks
scored in the first subject, marks [1] denotes the marks scored in 2nd subject and so on.

Is the array always of a fixed size?

In C language, the array has a fixed size meaning once the size is given to it, it cannot be
changed i.e., you can’t shrink it nor can you expand it. The reason was that for expanding if
we change the size, we can’t be sure (it’s not possible every time) that we get the next memory
location to us for free. The shrinking will not work because the array, when declared, gets
memory statically allocated, and thus compiler is the only one that can destroy it .

Types of indexing in an array: -

 0 (zero-based indexing): The first element of the array is indexed by a subscript of


0.
 1 (one-based indexing): The first element of the array is indexed by the subscript of
1.
 n (N-based indexing): The base index of an array can be freely chosen. Usually,
programming languages allowing n-based indexing also allow negative index
values, and other scalar data types like enumerations, or characters may be used as
an array index.

.D.Y.Patil Technical campus Faculty of Engineering and Faculty of Management,Talsande(Polytechinc)


Report on ALP to sum of smallest number in Array

How an Array is initialized?

By default, the array is uninitialized, and no elements of the array are set to any value.
However, for the proper working of the array, array initialization becomes important. Array
initialization can be done by the following methods:
o Passing no value within the initializer
o By passing specific values within the initializer
o By passing specific values within the initializer but not declaring the size
o Universal Initialization

Need of using Array: -

In programming, most of the cases need to store a large amount of data of a similar type. We
need to define numerous variables to store such a huge amount of data. While writing the
programs, it would be very tough to memorize all variable names. Instead, it is better to define
an array and store all the elements in it.

.D.Y.Patil Technical campus Faculty of Engineering and Faculty of Management,Talsande(Polytechinc)


Report on ALP to sum of smallest number in Array

Advantages of using array:

Arrays allow random access to elements. This makes accessing elements by


position faster.
Arrays have better cache locality which makes a pretty big difference in
performance.
Arrays represent multiple data items of the same type using a single name.

Disadvantages of using array:

You can’t change the size i.e., once you have declared the array you can’t change its size
because of static memory allocation. Here Insertion(s) and deletion(s) are difficult as the
elements are stored in consecutive memory locations and the shifting operation is costly too.

.D.Y.Patil Technical campus Faculty of Engineering and Faculty of Management,Talsande(Polytechinc)


Report on ALP to sum of smallest number in Array

Applications on Array

 Array stores data elements of the same data type.


 Arrays are used when the size of the data set is known.
 Used in solving matrix problems.
 Applied as a lookup table in computer.
 Databases records are also implemented by the array.
 Helps in implementing sorting algorithm.
 The different variables of the same type can be saved under one name.
 Arrays can be used for CPU scheduling.
 Used to Implement other data structures like Stacks, Queues, Heaps, Hash tables,
etc.

.D.Y.Patil Technical campus Faculty of Engineering and Faculty of Management,Talsande(Polytechinc)


Report on ALP to sum of smallest number in Array

Code: -

 public class SmallestInArrayExample


 {
 public static int getSmallest(int[] a, int total)
 {
 int temp,i,j;
 for (int i = 0; i < total; i++)
 {
 for (int j = i + 1; j < total; j++)
 {
 if (a[i] > a[j])
 {
 temp = a[i];
 a[i] = a[j];
 a[j] = temp;
 }
 }
 }
 return a[0];
 }
 public static void main(String args[])
 {
 int a[]={1,2,5,6,3,7};
 int b[]={44,66,99,77,33,22,55};
 System.out.println("Smallest: "+getSmallest(a,6));
 System.out.println("Smallest: "+getSmallest(b,7));
 }
 }

Output: -l 1

Smallest: 1

Smallest: 22

.D.Y.Patil Technical campus Faculty of Engineering and Faculty of Management,Talsande(Polytechinc)


Report on ALP to sum of smallest number in Array

Conclusion: -
Before we finish, here is a few definitions of the word "array" in different subjects...
In maths, an array is an arrangement of numeric values or symbols, arranged in rows and
columns.
In computing, an array is a series of objects that are the same size and type, or an indexed set
of related values.
And in general, the term "array" is used to describe an impressive or vast amount of a
particular type of item. He had a vast array of science fiction movies on his stall.

.D.Y.Patil Technical campus Faculty of Engineering and Faculty of Management,Talsande(Polytechinc)


Report on ALP to sum of smallest number in Array

Reference: -

 https://www.geeksforgeeks.org/smallest-number-to-make-array-sum-at-most-k-by-
dividing-each-element/

 https://www.geeksforgeeks.org/sum-and-product-of-minimum-and-maximum-
element-of-an-array/

 https://www.bietdvg.edu/media/department/EI/data/learning-
materials/arm_Lab_manual.pdf

 https://www.geeksforgeeks.org/maximum-sum-of-smallest-and-second-smallest-in-
an-array/

 https://mjcollege.ac.in/images/labmannuals/IV%20EIE%20I%20SEM%20MPMC%2
0LAB%20MANUAL(EE432).pdf

.D.Y.Patil Technical campus Faculty of Engineering and Faculty of Management,Talsande(Polytechinc)

You might also like