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

Find a Smallest Number Using Array

The document explains arrays as a data structure used to store elements of the same memory size, typically in a linear format. It presents a micro-project focused on finding the smallest number in an array using a straightforward algorithm that compares each element to a current minimum value. The algorithm is noted for its applications in sorting and data analysis, although specific time complexity details are not provided.

Uploaded by

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

Find a Smallest Number Using Array

The document explains arrays as a data structure used to store elements of the same memory size, typically in a linear format. It presents a micro-project focused on finding the smallest number in an array using a straightforward algorithm that compares each element to a current minimum value. The algorithm is noted for its applications in sorting and data analysis, although specific time complexity details are not provided.

Uploaded by

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

FIND A SMALLEST NUMBER USING ARRAY

INTRODUCTION:

What is an array?
In computer science, an array is a data structure
consisting of a collection of elements (values or
variables), of same memory size, each identified
by at least one array index or key. An array is
stored such that the position of each element can
be computed from its index tuple by a
mathematical formula. The simplest type of data
structure is a linear array, also called one-
dimensional array.
For example:
In array numbers are stored in linear manner,
that is they are either stored in ascending order
or in descending order.
But in most of the cases the number in respected
array are stored in ascending order
ABSTRACT:

In this micro-project we are going to find the


smallest number in an array .
Problem: Finding the smallest number in an
array is a common problem in computer science.
Methodology: The most straightforward way to
solve this problem is to repeat or go through the
array and compare each element with the
current minimum value. If the element is smaller
than the current minimum, update the minimum
value. This algorithm has time complexity.
Results: The algorithm successfully finds the
smallest number in an array with a time
complexity . This algorithm can be used in
various applications, such as sorting algorithms
and data analysis.
Its applications in different fields.
ALGORITHM:
Smallest code
.model small
.data
array dw 12h,31h 02h,45h,65h
sm db 0
.code
mov ax, @data
mov ds ,ax
mov si, offset array
mov al,[si]
dec cx
incsi
cmp al,[si]
next
mov al,[si]
next:
loop up
mov sm,al
mov al, 4ch
int 21h
end

You might also like