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
An administrator needs to make sure that video conferencing is allocated a high portion of bandwidth within a company network. W
frosja888 [35]

Answer:

QoS

Explanation:

We could use a blacklisting or a MAC filtering to remove from the network, and in this way, we're going to get a high portion of bandwidth, but other must work too, and the whitelisting have almost the same function, but QoS Quality of service is specifically for these cases where we need high bandwidth for a video conference, we can make this with some tools or techniques like jitter buffer and traffic shaping.

4 0
3 years ago
A degree-constrained minimum spanning tree is a minimum spanning tree (MST) where the maximum vertex degree is limited to a cert
Bingel [31]

Answer:

A spanning tree is a subset of Graph G, which has all the vertices covered with minimum possible number of edges. Hence, a spanning tree does not have cycles and it cannot be disconnected..

By this definition, we can draw a conclusion that every connected and undirected Graph G has at least one spanning tree. A disconnected graph does not have any spanning tree, as it cannot be spanned to all its vertices.

Spanning Trees

We found three spanning trees off one complete graph. A complete undirected graph can have maximum nn-2 number of spanning trees, where n is the number of nodes. In the above addressed example, n is 3, hence 33−2 = 3 spanning trees are possible.

General Properties of Spanning Tree

We now understand that one graph can have more than one spanning tree. Following are a few properties of the spanning tree connected to graph G −

A connected graph G can have more than one spanning tree.

All possible spanning trees of graph G, have the same number of edges and vertices.

The spanning tree does not have any cycle (loops).

Removing one edge from the spanning tree will make the graph disconnected, i.e. the spanning tree is minimally connected.

Adding one edge to the spanning tree will create a circuit or loop, i.e. the spanning tree is maximally acyclic.

Explanation:

8 0
3 years ago
Research the design basis threat (DBT) in terms of Cybersecurity for an organization of your choice. Discuss what the Cybersecur
tiny-mole [99]

A Design Basis Threat (DBT) is known to be a characteristics of any given or potential insider and also those of external adversaries, that may try to have or gain unauthorized removal or sabotage, against a physical protection system that was set up designed and evaluated.

<h3>What are Cybersecurity objectives?</h3>

Cybersecurity aims are:

  • To protect computer system,
  • To protect networks,
  • To protect software programs from such cyber attacks.

Note that a lot of digital attacks are targeted at accessing, changing, or deleting sensitive information as well as others.

Learn more about IT from

brainly.com/question/1276995

#SPJ1

3 0
1 year ago
What is copyrights used for​
Inga [223]

if something belongs to someone it makes it so someone else cannot steal it and claim it to be their own

4 0
3 years ago
Read 2 more answers
I had no computer-related problems.
padilas [110]
Ummmmmmm A, agree???
8 0
3 years ago
Read 2 more answers
Other questions:
  • A. True
    6·1 answer
  • type the correct answer in the Box spell the words correctly Caleb is working on a simple logic base program to stimulate the ga
    5·2 answers
  • A model release can be either oral or written down. true or false
    11·2 answers
  • Which answer would it be?
    12·1 answer
  • When an object is acted on by unbalanced forces, the object will always
    11·1 answer
  • Round 74,361 to the nearest 10​
    6·1 answer
  • Define input hardware​
    12·1 answer
  • You decide to test an audio clip that you have inserted into your presentation, but before you do that you make sure that the co
    6·1 answer
  • with the current computer development, explain 5th areas where computer is applied for the social economic dwvelopment in societ
    11·1 answer
  • Software that communicates with the hardware and allows other programs to run. It is comprised of system software, or the fundam
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!