Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(i) Design BRUTE FORCE algorithms for the below given tasks. It is appreciated to keep your algos python/C++/Java free. (ii) Roughly calculate how many (loop

image text in transcribed

(i) Design BRUTE FORCE algorithms for the below given tasks. It is appreciated to keep your algos python/C++/Java free.

(ii) Roughly calculate how many (loop ) iterations are being done in each given task.

Practice Task 1: T is one-dimensional array of integers. Write an ALGORITHM to search for a data value (entered by user) from T. If VAL is present in the array then the program should return value 1 and 0 otherwise. Note: You have to check only one occurrence of the VAL. Your list/array is sorted in ascending order. Do you get a flavour of Brute Force here?

Practice Task 2: T is one-dimensional array of integers. Write an ALGORITHM to find the frequency of a data value (entered by user) from T. Your list/array is sorted in ascending order. Do you get a flavour of Brute Force here?

Practice Task 3: Design an ALGORITHM which takes 10 consecutive numbers in a linear structure (e.g. 1 Dimensional array) and add like this to put the sum in another array. Numbers Entered: (say) 1 2 3 4 5 6 7 8 9 Resultant Sum Array 1 3 (1+2) 6 (1+2+3) ... ... ... ... ... ... Do you get a flavour of Brute Force here?

Practice Task 4: Design an ALGORITHM which takes 20 numbers in a linear structure (e.g. 1 Dimensional array/list) put their square in another one (array2) and calculate their x4 in array3. Write machine/language independant algorithm. Do you get a flavour of Brute Force here?

Practice Task 5: Design an ALGORITHM which takes 10 consecutive numbers in a linear structure (e.g. 1 Dimensional array) and take their factorial in another array. Numbers Entered: (say) 1 2 3 4 5 6 7 8 9 Resultant Sum Array 1 2 (2*1) 6 (3*2*1) 24 (4*3*2*1) ... ... ... ... ... Do you get a flavour of Brute Force here?

Practice Task 6: Take the sum of Left-to-Right diognal of a 2-Dimensional Matrix. Do you get a flavour of Brute Force here?

Practice Task 7: Sort a list in ascending order via-brute force. Can you do this? It must be easy now!

Time to learn and practice concepts. - Trivial Tasks via Brute Force Approach 1 of 2 Ngorithms refers to a programming style that does not include any shortcuts pre performance, but instead relies on sheer computing power to try all possibilities until the solution to a problem is found o Design BRUTE FORCE algorithms for the below given tasks it is appreciated to keep your alpos "python/C++/lava free () Roughly calculate how many (loop) iterations are being done in each given task Practice Task 1 T is one-dimensional array of integers. Write an AL.CORITHM to search for a data value (entered by user) from T. IVAL present in the array then the program should return value 1 and otherwise. Note: You have to check only one occurrence of the VAL Your list/array is sorted in ascending order. Do you get a flavour of Brute Force Practice Task 2: Tis ce dimensional array of interpersWrite ALGORITHM to find the frequency of a data value entered by user) from T. Your list array is sorted in ascending order. Do you get a flavour of Brute Force here? Practice Taktignan ALGORITHM which takes 10 consecutive numbers in a linear structurele 1 Dimensional array) and add like this to put the sum in an array Number 1 3 Entered Kesultant 1 3 6 Sum (1-2) (1+2+3) Array 6 9 Do you get a favour of Brute Force here? Practice Tusk : Dean ALGORITHM which takes 20 numbers in a linear structurele 1 Dimensional array/list) put their square interne array) and calculate their in array. Write mache/language independent algorithm Do you get a flavoured rute Force here COMP 301-ALGO Activity and Senior Practice Task Design an ALGORITHM which takes 10 consecutive numbers in a linear structure (ca 1 Dimensional ray) and take their factorial in another array, Numbers 1 2 3 17 18 9 Entered Resultant 12 24 Sum 2012 (30) Array Do you get a flavour of rute Force here? Practice Task Take the sum of Letto-Right dopral of a 2-Dimensional Statrix Do you eta favor of frute Force here! Practek 7: Sort a la in a list in ascending order via-brute turce. Can you do this? it must be Time to learn and practice concepts. - Trivial Tasks via Brute Force Approach 1 of 2 Ngorithms refers to a programming style that does not include any shortcuts pre performance, but instead relies on sheer computing power to try all possibilities until the solution to a problem is found o Design BRUTE FORCE algorithms for the below given tasks it is appreciated to keep your alpos "python/C++/lava free () Roughly calculate how many (loop) iterations are being done in each given task Practice Task 1 T is one-dimensional array of integers. Write an AL.CORITHM to search for a data value (entered by user) from T. IVAL present in the array then the program should return value 1 and otherwise. Note: You have to check only one occurrence of the VAL Your list/array is sorted in ascending order. Do you get a flavour of Brute Force Practice Task 2: Tis ce dimensional array of interpersWrite ALGORITHM to find the frequency of a data value entered by user) from T. Your list array is sorted in ascending order. Do you get a flavour of Brute Force here? Practice Taktignan ALGORITHM which takes 10 consecutive numbers in a linear structurele 1 Dimensional array) and add like this to put the sum in an array Number 1 3 Entered Kesultant 1 3 6 Sum (1-2) (1+2+3) Array 6 9 Do you get a favour of Brute Force here? Practice Tusk : Dean ALGORITHM which takes 20 numbers in a linear structurele 1 Dimensional array/list) put their square interne array) and calculate their in array. Write mache/language independent algorithm Do you get a flavoured rute Force here COMP 301-ALGO Activity and Senior Practice Task Design an ALGORITHM which takes 10 consecutive numbers in a linear structure (ca 1 Dimensional ray) and take their factorial in another array, Numbers 1 2 3 17 18 9 Entered Resultant 12 24 Sum 2012 (30) Array Do you get a flavour of rute Force here? Practice Task Take the sum of Letto-Right dopral of a 2-Dimensional Statrix Do you eta favor of frute Force here! Practek 7: Sort a la in a list in ascending order via-brute turce. Can you do this? it must be

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Deflation Current And Historical Perspectives

Authors: Richard C. K. Burdekin, Pierre L. Siklos

1st Edition

0521837995,0511227671

More Books

Students also viewed these Finance questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago

Question

why do consumers often fail to seek out higher yields on deposits ?

Answered: 1 week ago