A function that uses the binary search algorithm to search for a value in an array a. repeatedly divides the elements into the number of segments you specify and discards the segments that don’t have the value until the value is found and a pointer to the element is returned b. repeatedly divides the elements in half and discards the half that doesn't have the value until the value is found and a pointer to the element is returned c. repeatedly divides the sorted elements in half and discards the half that doesn't have the value until the value is found and the index of the element is returned d. repeatedly divides the elements into the number of segments you specify and discards the segments that don’t have the value until the value is found and the index of the element is returned

Answers

Answer 1

Answer:

c. repeatedly divides the sorted elements in half and discards the half that doesn't have the value until the value is found and the index of the element is returned.

Explanation:

When binary search is used for algorithm search then the work is searched in the sorted array. There arrays are divided in half and then half of the elements are discarded who does not have value. The search does not completes until it founds the value and index of the element.


Related Questions

discribe two ways you can zoom in and out from an image

Answers

How to zoom in: u get any two of ur fingers and instead of going inward like ur tryna pop a zit, you go out

How to zoom out: pretend like ur popping pimples on ur phone/device screen

11111 Power 2 sovle ​

Answers

123,454,321. you just multiply 11111 by itself

Write a program get_price.py with a function get_price() that takes a dictionary of fruits as an argument and returns the name of the most expensive fruit. Each item of the dictionary includes: A key: the name of the fruit A value: the price of the fruit.

Answers

Answer:

The program is as follows:

def get_price(fruits):

   AllPrice = fruits.values()

   value_iterator = iter(AllPrice)

   mostExpensive = next(value_iterator)  

   for item in fruits:

       if fruits[item]>=mostExpensive:

           mostExpensive = fruits[item]

           fruitName = item

   print(fruitName)

fruits = {}

n = int(input("Number of Fruits: "))

for i in range(n):

   name = input("Fruit name: ")

   price = int(input("Fruit price: "))

   fruits[name] = price

get_price(fruits)

Explanation:

This defines the get_price function

def get_price(fruits):

This gets all price in the dictionary fruit

   AllPrice = fruits.values()

This passes the values to a value iterator

   value_iterator = iter(AllPrice)

This initializes mostExpensive to the first price in the dictionary

   mostExpensive = next(value_iterator)

This iterates through the elements of the dictionary  

   for item in fruits:

If current element is greater than or equals most expensive

       if fruits[item]>=mostExpensive:

Set most expensive to the current element

           mostExpensive = fruits[item]

Get the corresponding fruit name

           fruitName = item

Print fruit name

   print(fruitName)

The main begins here

This initializes the fruit dictionary

fruits = {}

This gets input for the number of fruits

n = int(input("Number of Fruits: "))

This is repeated for every inputs

for i in range(n):

Get fruit name

   name = input("Fruit name: ")

Get fruit price

   price = int(input("Fruit price: "))

Append name and price to dictionary

   fruits[name] = price

Call the get_price function

get_price(fruits)

5. A student wants to send a picture to the printer, how should they
send it?
a. 0,99,0
b. -65, 10, 5,0
c. 115, 118,0
d. #584504

Answers

Answer:

d

Explanation:

Components of micro computer with diagram

Answers

Answer:

CPU, Program memory, Data memory, Output ports,  Input ports and Clock generator.

Explanation:

There are six basic components of a microcomputer which includes CPU, Program memory, Data memory, Output ports,  Input ports and Clock generator. CPU is the central processing unit which is considered as the brain of the computer. It is the part of a computer that executes instructions. Data memory is the place where data is stored that is present in the CPU.

3. Write a program that prompts the user to input an integer that represents cents. The program will then calculate the smallest combination of coins that the user has. For example, 27 cents is 1 quarter, 0 nickle, and 2 pennies. That is 27=1*25+0*5+2*1.

Answers

Answer:

The program in Python is as follows:

cents = int(input("Cents: "))

qtr = int(cents/25)

cents = cents -qtr * 25

nkl = int(cents/5)

pny = cents -nkl * 5

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

Explanation:

This gets input for cents

cents = int(input("Cents: "))

This calculates the quarters in cents

qtr = int(cents/25)

This gets the remaining cents

cents = cents -qtr * 25

This calculates the nickel in remaining cents

nkl = int(cents/5)

This calculates the pennies in remaining cents

pny = cents -nkl * 5

This prints the required output

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

Develop Swimlane Activity diagram for Assignment announcement and submission system.

Answers

Using cases can be visualized in greater detail in this report of an activity diagram. In other words, it's a behavioral diagram that regulates the number of actions via systems. They can also be used to show sequences of activities in business operations. UML Activity Diagrams A business process can be examined to determine its flow and demands that use these tools.

The steps to this question can be defined as follows:

For step 1:

The task is to decide the action steps depending upon your use case.

For step 2: Identify all parties involved

If you know whoever the actors are, it's easier to determine the acts they are liable for.

For step 3: Establish a movement among activities

Change the priority in which the action is required by studying the flowchart. If you need to add any branches to the graph, note the conditions that must be met for certain processes to take place. Furthermore, do you even have to finish some tasks before moving onto someone else?

For step 4: Adding swimlanes

We know who is to blame for each act. It's time to assign everyone a swimming lane and group every action they are accountable for under it.Some many activities and actions make up your sales system or process.

Please find the diagram in the attachment file.

Learn more:

Assignment submission: brainly.com/question/11714037

Give examples of applications that access files by each of the following methods:
+ Sequentially.
+ Random.

Answers

Answer:

Explanation:

Usually, applications would have the capability of using either one of these options. But for the sake of the question here are some that usually prefer one method over the other.

Any program that targets an API usually uses Sequential access. This is because API's contain all of the data as objects. Therefore, you need to access that object and sequentially navigate that object to the desired information in order to access the data required.

A music application would have access to an entire folder of music. If the user chooses to set the application to randomly play music from that folder, then the application will use a Random Access method to randomly choose the music file to load every time that a song finishes.

You are going to purchase (2) items from an online store.
If you spend $100 or more, you will get a 10% discount on your total purchase.
If you spend between $50 and $100, you will get a 5% discount on your total purchase.
If you spend less than $50, you will get no discount.
Givens:
Cost of First Item (in $)
Cost of Second Item (in $)
Result To Print Out:
"Your total purchase is $X." or "Your total purchase is $X, which includes your X% discount."

Answers

Answer:

Code:-

using System;

using System.Collections.Generic;

class MainClass {

public static void Main (string[] args) {

int Val1,Val2,total;

string input;

double overall;

Console.Write("Cost of First Item (in $)");

      input = Console.ReadLine();

Val1 = Convert.ToInt32(input);

Console.Write("Cost of Second Item (in $)");

      input = Console.ReadLine();

Val2 = Convert.ToInt32(input);

total=Val1+Val2;

if (total >= 100)

{

overall=.9*total;

Console.WriteLine("Your total purchase is $"+overall);

}

else if (total >= 50 & total < 100)

{

overall=.95*total;

Console.WriteLine("Your total purchase is $"+overall);

}  

else

{

Console.WriteLine("Your total purchase is $"+total);

}  

}

}

Output:

hi, please help me.solution.​

Answers

Answer:

aahdbdnsjajaissjdjdhskakwjdhbebs

explain the working principle of computer? can anyone tell​

Answers

Answer:

input process and output hehe

What can be used to store data, plant viruses, or steal data?

Answers

Answer:

ITS A SIMPLE ANSWER BUT THE PROBLEM IS TOO BIG!

Explanation:

The phishing email might contain a link which on clicking will take you to a fake web page. For example, the link might take you to a fake bank website which looks very legitimate but in reality is just a lookalike. If the victim falls for the scam and enters his/her account details on the website, the details will actually go to the hacker's server instead of going to the bank and the hacker will have all the information that the victim has provided on the website.


Calculator is an example of
computer
A. analogue
B. hybrid
C. manual
D. digital
E. public​

Answers

D. digital

Explanation:

I hope it helps you

WHAT IS ONE WAY A PIVOTTABLE COULD COMBINE THE FOLLOWING DATA

Answers

Answer: You sort table data with commands that are displayed when you click a header arrow button. Hope it help's :D

(1)similarities between backspace key and delete key. (2) different between backspace key and delete key. (3) explain the term ergonomics. (4) explain the following. a click b right click double click d triple click e drag and drop.​

Answers

Answer:

ddhejaajegxhzi

Explanation:

jfrhsjadigugud

PartnerServer is a Windows Server 2012 server that holds the primary copy of the PartnerNet.org domain. The server is in a demilitarized zone (DMZ) and provides name resolution for the domain for Internet hosts.
i. True
ii. False

Answers

Answer:

i. True

Explanation:

A Domain Name System (DNS) can be defined as a naming database in which internet domain names (website URLs) are stored and translated into their respective internet protocol (IP) address.

This ultimately implies that, a DNS is used to connect uniform resource locator (URL) or web address with their internet protocol (IP) address.

Windows Server 2012 is a Microsoft Windows Server operating system and it was released to the general public on the 4th of September, 2012, as the sixth version of the Windows Server operating system and the Windows NT family.

PartnerServer is a Windows Server 2012 server that was designed and developed to hold the primary copy of the PartnerNet dot org domain.

Typically, the server is configured to reside in a demilitarized zone (DMZ) while providing name resolution for the domain of various Internet hosts.

In order to prevent a cyber attack on a private network, end users make use of a demilitarized zone (DMZ).

A demilitarized zone (DMZ) is a cyber security technique that interacts directly with external networks, so as to enable it protect a private network.

25. Các phát biểu nào sau, phát biểu nào là đúng:
- tên file không được chứa khoảng trắng
- tên file không nên có dấu tiếng viết
- tên file được dài trên 255 ký tự
- tên file được chấp nhận ký tự khác

Answers


-tên file được chấp nhận ký tự khác

The SEI/CERT website is full of best-practices for developing secure code for various popular programming languages. Select a software threat/vulnerability of your choice and idenitfy two secure coding practices to mitigate that threat/vulnerability. You may choose any programming language you wish.

Answers

Answer:  

Input-Output rule:  

char *file_name:

FILE *f+ptr;  

f_ptr = fopen(file_name, "w");

if(f_ptr == NULL){

}  

if(fclose(f_ptr)!=0){

}  

if(remove(file_name) !=0){

}  

Expression:  

void set_fl(int num ,int *s_fl){

if(NULL == s_fl){

return;

}  

if(num>0){

*s_fl =1;

}

else if(num <0) {

*s_fl = -1;

}

}  

int is_negative(int num) {

int s;

set_fl(num , &s);

return s<0;

Explanation:  

Computer Emergency Response Team(CERT) has found most vulnerabilities discovered in applications stem from a comparatively small number of common programming errors that developers repeatedly make. The CERT secure coding initiative is functioning to determine secure coding standards for commonly used programming languages and to advance the practice of secure coding.

There are many security coding practices:  

SEI CERT C coding standard:  

The C rules and proposals are a piece ongoing and reflect the present thinking of the secure coding community. As rules and proposals mature, they're published in report or book form as official releases.

Select the correct statement(s) regarding IP addressing.
a. IPv4 and IPv6 addressing is fully compatible with one another.
b. CIDR address format represents a Class C network only used within an intranet.
c. Subnet masks are used with both class and classless IP addresses.
d. all statements are correct.

Answers

Yeah the answer is b

Subnet masks are used with both class and classless IP addresses is the correct statement. Therefore, the correct option is C.

What is an IP address?

A device on the internet or a local network may be identified by its IP address, which is a special address. The rules defining the format of data delivered over the internet or a local network are known as “Internet Protocol,” or IP.

Only C is correct, rest other statements are incorrect because:

a. IPv4 and IPv6 addressing is fully compatible with one another is incorrect. While IPv4 and IPv6 can coexist on the same network, they are not fully compatible with one another.

b. CIDR address format represents a Class C network only used within an intranet is incorrect. Classless Inter-Domain Routing (CIDR) is a technique used to allocate IP addresses more efficiently.

Therefore, subnet masks are used with both class and classless IP addresses is the correct statement. Therefore, the correct option is C.

Learn more about,  here

https://brainly.com/question/3805118

#SPJ6

give one advantage of saving file in the same folder

Answers

Answer:

it's easier to find

Explanation:

things are much more organized

So you don’t have to go through many files

What values are in the vector named pressures after the following code is executed? vector pressures; pressures.push_back(32.4); pressures.push_back(33.5); pressures.insert(pressures.begin(), 34.2); int index = 2; pressures.insert(pressures.begin() + index, 31.8); pressures.push_back(33.3); index = 1; pressures.erase(pressures.begin() + index); a. 34.2, 31.8, 33.3 b. 34.2, 33.5, 31.8, 33.3 c. 34.2, 33.5, 33.3 d. 34.2, 31.8, 33.5, 33.3

Answers

Answer:

Hence the correct option is A that is "34.2 31.8 33.5 33.3".

Explanation:  

Program:-  

#include <iostream>

#include<vector>  

using namespace std;  

int main()

{

int count =0;

vector<double> pressures;

pressures.push_back(32.4);

pressures.push_back(33.5);

pressures.insert(pressures.begin(), 34.2);

int index = 2;

pressures.insert(pressures.begin() + index, 31.8);

pressures.push_back(33.3);

index = 1;

pressures.erase(pressures.begin() + index);

for (auto it = pressures.begin(); it != pressures.end(); ++it)

cout << ' ' << *it;

return 0;

}

g A catch block that expects an integer argument will catch Group of answer choices all exceptions all integer exceptions any exception value that can be coerced into an integer C

Answers

Answer:

Hence the correct option is 2nd option. all integer exceptions.

Explanation:

A catch block that expects an integer argument will catch all integer exceptions.

Over-activity on LinkedIn?

Answers

Answer:

Being over-enthusiastic and crossing the line always get you in trouble even if you’re using the best LinkedIn automation tool in the world.  

When you try to hit the jackpot over the night and send thousands of connection requests in 24 hours, LinkedIn will know you’re using bots or tools and they will block you, temporarily or permanently.    

This is clearly against the rules of LinkedIn. It cracks down against all spammers because spamming is a big ‘NO’ on LinkedIn.    

What people do is that they send thousands of connection requests and that too with the same old spammy templates, “I see we have many common connections, I’d like to add you to my network.”    

It will only create spam.    

The LinkedIn algorithm is very advanced and it can easily detect that you’re using a bot or LinkedIn automation tool and you’ll be called out on it.

Code Example 9-1 struct Product { string name; double price; int quantity; }; (Refer to Code Example 9-1.) Given a Product object named product, which of the following statements would you use to display the value of the name data member on the console? a. cout << product::name; b. cout << product.name; c. cout << product("name"); d. cout << product[0];

Answers

Answer:

a. cout << Product ::name;

Explanation:

Computer software use different languages which helps user to initiate command. When a user initiates command the results are displayed according to input command. If product name is required as output then insert command should be product::name; this will display names of different products present in the system.

Neymar machine that Run on electricity

Answers

"Neymar" = "name a"?

if so, well, there are many, like the little glowing box you use the type questions to the brainliest community, let it be a phone, a pc, or a molded Nintendo

if you meant Neymar indeed, I'm not sure if he runs on electricity, unless he is a soccer playing android somehow.

The internet's data pathways rely on what kind of hardware device to route data to its destination?
servers

routers

IP addresses

ISPs

Answers

Answer:

Routers

Explanation:

Essentially a router is a device used in networking that route packets of data from one computer network to another.

Answer:

routers

Explanation:

Routers are hardware devices that route the data from place to place. Data "hops" from one router to another until it reaches its destination. ISPs and IP addresses are not hardware devices. Servers are hardware devices but do not route data.

-Edge 2022

Peter is a new business owner. Because Peter is on a strict budget, he uses an older Novell NetWare server. The NetWare server still relies on the legacy IPX/SPX network protocol suite. Peter needs to connect his server to the Internet. He decides to use a gateway instead of a router. What is the likely motive behind Peter's decision

Answers

The most likely motive of Peter's decision to use a gateway for connecting his serve to the internet is to get a wireless connection for the internet.

A gateway server is used to communicate to the internet service provider. It is used to receives the data. It helps to sends the data to the router in order to translate as well as distribute the wireless devices.

In the context, Peter who is on a strict budget uses gateway system to connect to the internet and he uses the older version of Novell NetWare server.

Learn More :

https://brainly.in/question/35731153

Is IBM 1041, Minicomputer? Yes or no​

Answers

Answer:

No

Explanation:

College
START: what new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its important to START doing this right away

Answers

Answer:

Read Technical Books. To improve your technical skills and knowledge, it's best to read technical books and journals. ...

Browse Online Tutorials. ...

Build-up online profile. ...

Learn new Tools. ...

Implement what you learned. ...

Enrich your skillset. ...

Try-out and Apply.

Question No: 9 Of 50 Time Left : 59:18
ОА
QUESTION
Which of the following two entities (reading from Left to right) can be connected by the dot operator?
A class member and a class object.
A class object and a class,
A constructor and a member of that class.
OB
Ос
OD
A class object and a member of that class.

Answers

Answer:b

Explanation:

to get points

Other Questions
Software piracy occurs whenpeople steal things while sailing the seas.someone steals software.someone sells their own intellectual property.someone shares gossip about other people. The water evaporated. How did that help ? Find the word which is not the same with the others in agroup A well B sick C healthy D fit A live B smile C sleep D happy A certain volume of gas S takes 180 secs to diffuse through a porous plug. An equal amount of gas Q takes 240 secs to diffuse the same plug. Calculate the molar mass of gas Q if the molar mass of gas S is 18. Find the missing value in each figure below. What does y equal? The weight of oranges growing in an orchard is normally distributed with a mean weight of 7 oz. and a standard deviation of 1 oz. Using the empirical rule, what percentage of the oranges from the orchard weigh between 4 oz. and 10 oz.? pls help me with in this i just want the 3 and 4th one... Which best describes the communication strategy of "being flexible"?A. Avoiding a focus on "right vs. wrong" and listening insteadB. Encouraging others to express genuine thoughts and feelingsC. Negotiating needs and meeting someone else halfwayD. Repeating back what you've been told to confirm the message Another bank is also offering favorable terms, so Rahul decides to take a loan of $18,000 from this bank. He signs the loan contract at 11% compounded daily for three months. Based on a 365-day year, what is the total amount that Rahul owes the bank at the end of the loan's term Please help me out with how to solve this In a math class, one of your 4 test scores is dropped. On the first three tests, you have the following scores: 79, 34, and 95. What score do you need on the next test for your average to be 75 (assuming you drop the lowest test score)? 6. What effects might a female marijuana user experience?a. Higher testosterone levelsb. Changed hormone levelsC. Infertilityd. All of the above Indicative or Subjunctive? The following sentences contain expressions of doubt and certainty. The verbs have been conjugated for you in the indicative and the subjunctive. Decide which conjugation is appropriate for the situation and either cut and paste it into the blank, or retype it yourself.Dudo que _____ ayudarme. (puedes / puedas)Es cierto que ella _____ razn. (tiene / tenga)Crees que mi madre me ______? (ayuda / ayude)Creo que ella _____ tu ayuda. (necesita / necesite)Es posible que nosotros ____tarde esta noche. (comemos / comamos) What is y if the ordered pair (25, y) is a solution of the equation shown? Michelle is attending a university where tuition for one year costs $17,300. She has a scholarship worth $5,000 per year. She earns $2,700 per year at her part-time job. She plans to take out a loan to cover the remaining tuition costs. Tuition will increase by $500 each year. If she completes college in 4 years, how much money will Michelle need to borrow josh is standing on the top of a building that is 425 feet tall. He throws a penny up into the air with an initial of 32 ft/sec. How long does it take for the penny to hit the ground?Y = -4.9x^2 + 32x + 425A. 10 seconds B. 6.25 C. 400 D. 0 seconds Which of the following are interior angles in the figure below?OA. 21, 22, and 26B. 25 and 26C. 23 onlyD. 21, 22, and 23 Among the many benefits of learning another language is expanding one's cultural horizons. OT OF ________________ is another name for Kush.a.Egyptc.Ghanab.Nubiad.Great Zimbabwe over population is causing more problem than we can imagine 8, 4, 0, 4, 8, 12 What do these terms represent? an arithmetic series an arithmetic sequence a geometric series a geometric sequence