logo

THE ARTIFICIAL INTELLIGENCE

   

Added on  2022-09-09

9 Pages1495 Words22 Views
Running head: ARTIFICIAL INTELLIGENCE
ARTIFICIAL INTELLIGENCE
Name of the Student
Name of the University
Author Note
THE             ARTIFICIAL      INTELLIGENCE_1
ARTIFICIAL INTELLIGENCE
1
Abstract:
Searching algorithms are very common in artificial intelligence as they are employed based
on their advantage and efficiency on the given problem. The searching algorithms are
basically used to fetch an element stored in a single or multidimensional array where it stored
along with other elements. The type of search operation classifies the searching algorithms in
two categories namely sequential search and Interval search. Sequential search operates
traversing an array sequentially by checking each of the element in the array. Linear search is
an example of sequential search type. The interval search is applied particularly on sorted
arrays and these are generally have less time complexity than the sequential search
algorithms. This is because the in interval search the centre of a array structure is targeted and
based on the centre the search space is divided in two halves of approximately same length.
Binary search algorithm falls under interval search.
THE             ARTIFICIAL      INTELLIGENCE_2
ARTIFICIAL INTELLIGENCE
2
Introduction:
Now, in this particular research two search algorithms are applied two find the minimum 5
values from an array which makes the sum of square minimum. Now, sorting the array in
ascending order gives the first five elements of the array which has the minimum sum of
square as square of a number is always positive. Hence, two algorithms are applied to sort the
array in ascending order (Wu and Chiang 2018). The chosen two sorting algorithms are
selection sort and bubble sort as both are very simple to implement and efficiently applied on
any data array.
Search 1:
Now, as mentioned previously the searching algorithms are basically sorting algorithms for
the case as for finding the five elements which gives smallest sum of square from a list of
array of length more than 5, the list is needed to be sorted first and then the first five elements
can easily be chosen. The first sorting algorithm is the selection sort algorithm in which the
minimum of the array is first calculated and placed in the left of the list (Mohammed,
Amrahov and Çelebi 2017). Then the minimum of the rest of the array is calculated and it is
placed in just right of the first minimum. The minimum of a list can be calculated by iterating
through the list pairwise and keeping the updated minimum in the memory.
Pseudo code of search 1:
Input array of length n.
Define sorted_array = selection_sort(array):
sorted_array = [];
for i=n to 1:
min = Min_list(array) to i elements.
THE             ARTIFICIAL      INTELLIGENCE_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
THE ARTIFICIAL INTELLIGENCE
|9
|1215
|17

Sorting Algorithms
|7
|968
|43

COMP3821 Extended Algorithms and Programming Techniques
|5
|2703
|54

Advanced Algorithm Analysis - Desklib
|8
|1712
|254

Advanced Algorithm Analysis: Recurrence Trees, Divide-and-Conquer Technique, and Universal Sink
|9
|2086
|492