1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pychu [463]
3 years ago
8

Given a vector and a starting position, find the index of // the smallest value in the range [start, last], where last is // vec

tor.size()-1. That index is returned.
Computers and Technology
1 answer:
marusya05 [52]3 years ago
7 0

Answer:

The solution code is written in Python

  1. def findSmallest(vec, start):
  2.    index = start
  3.    smallest = vec[start]
  4.    for i in range(start + 1, len(vec)):
  5.        if(smallest > vec[i]):
  6.            smallest = vec[i]
  7.            index = i
  8.    return index

Explanation:

Firstly we can define a function findSmallest() that takes two input parameters, a vector, <em>vec</em>, and a starting position, <em>start </em> (Line 1).

Next, create two variables, <em>index</em> and <em>smallest</em>, to hold the current index and current value where the smallest number is found in the vector. Let's initialize them with <em>start</em> position and the value held in the<em> start </em>position (Line 3-4).

Next, create a for-loop to traverse through the next value of the vector after start position and compare it with current <em>smallest </em>number. If current <em>smallest</em> is bigger than any next value in the vector, the <em>smallest </em>variable will be updated with the new found  lower value in the vector and the index where the lower value is found will be assigned to variable<em> index</em>.

At the end return index as output.

You might be interested in
___________is used for drawing 3D objects in the field of Science and Engineering.
Westkost [7]

Answer:

the answer is C mri hope this helps

Explanation:

6 0
3 years ago
Read 2 more answers
A company wishes to deploy a wireless network. Management insists that each individual user should have to authentic.ate with a
kap26 [50]

Answer:

A company wishes to deploy a wireless network. Management insists that each individual user should have to authentic.ate with a unique username and password before being able to associate with the wireless access points. Which of the following wireless features would be the MOST appropriate to achieve this objective?

Option A is the correct answer -  WPA2 PSK.

Explanation:

Data is the most essential asset for obtaining knowledge and information. Therefore, it has to be protected from various threats. However, the wireless network provides the option of sharing data without wires, but it is flying in the air. Thus, to secure it, we need to secure it with the right tools.

Option A: WI-FI Protected Access Pre-shared-Key (WPA2 PSK) is the best protection tool because it has 2 modes-PSK and Enterprise mode.

7 0
3 years ago
Read 2 more answers
When a cells number format is “time” it will show a value in what format
Leokris [45]

The format of time shows a value of time day (what time it is).

When you choose the option of time you can have it displayed in a variety of formats, including military time and a time display that will change with regional time zones,

3 0
3 years ago
Role of computers in everyday life​
Simora [160]

Answer:

In modern word everything around us like GPS, ATM machines, cell phones, petrol pumps, portable play stations and all other modern devices use computer controlling units to conduct their featured operations. Surely computers have very elaborated role in daily day life of humans.

Explanation:

hope it helps thxs

8 0
3 years ago
User ideas for ro blox?
AveGali [126]

Answer:

You can put random people, or something you like to do, like Soccer2347 (that was just an example) or your favorite animal, Horse990. But Rob lox has to approve it first

Explanation:

7 0
3 years ago
Other questions:
  • What does in-private or incognito browsing do?
    5·1 answer
  • Which type of transmission do modems use ?
    15·2 answers
  • To run a PHP application that has been deployed on your own computer you can enter a URL in the address bar of your browser that
    7·1 answer
  • 14<br> Select the correct answer.<br> Which activity is a marketing technique?
    9·1 answer
  • . Write a code to define a linked list node using the above defined structure student (i.e. the data of the node is a student st
    11·1 answer
  • Please select all examples of systems using guided media. Group of answer choices ADSL 802.11 Wifi Home Networks Global Position
    5·1 answer
  • The process of ensuring that web pages coded with new or advanced techniques still are usable in browsers that do not offer supp
    14·1 answer
  • Your textbook discussed a record store example where one user could perform a query to determine which recordings had a track le
    14·1 answer
  • One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a numbe
    8·1 answer
  • Python Programming
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!