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
madam [21]
3 years ago
13

Hi everyone! I was wondering if any of you want to help me with a computer science problem I have for one of my classes. I do no

t understand how to do it which is why I ask.
Here is the problem: Write an algorithm for placing a set of pencils in order from largest to smallest (left to right).

I learned other sorting algorithms but I don't quite understand how to implement them into my own algorithm.

Thanks.
Computers and Technology
1 answer:
nirvana33 [79]3 years ago
5 0

Answer:

Use bubble sorting

Here is an example program I made:

for(int i = 0; i < length; i++){

     for(int j = 0; j < length; j++){

       if(j != length - 1){

         if(input[j] > input[j + 1]){

          storeVar = input[j];

         

          input[j] = input[j+1]; //storeVar2;

         

          input[j+1] = storeVar;

         }

       }

     }

You might be interested in
After merging two arrays is complete you need to
VikaD [51]

Answer: C) copy the merged array back to the original array

Explanation:

 After performing merging of two array then, copy the merge array back to its original array. Merging of two array is done by the process of merge sort. Merging of two array is the similar process of concatenate the two array into the single object.

It basically works on the principle of divide and conquer algorithm. It divide the input value into the two half and then, sorted the accordingly. Then after completion of merging the two array it copy into the original array.

5 0
3 years ago
Today's Apple Mac computers run with the same I-Ternal hardware as the Windows based PC true or false
Ksivusya [100]
Kinda of both. The processor, memory, hard drive and displays are all standard components and are provided by a variety computer competent manufacturers (except for the processors which are all supplied by Intel). Yet - while many components are standard - NO, the core, hardware components, like logic boards (motherboard), video cards, and other specialty components (some display connectors and displays, for example) are propriety Apple designs.
5 0
3 years ago
Give several reasons why Python is such a great programming language. Explain how Python is related to flowcharts. (students mak
Mekhanik [1.2K]

It is great but that's really it.

Don't get me wrong I adore Python, no complications, pure simplicity, wonderful community. But for any larger project that will be scaled I'd never use it. It's slow (mostly because of GIL) and gets pretty hard to organise once you have thousands of .py files but it's still a great language (my first one) when doing quick prototyping, personal projects, learning and it's also AI de facto programming language because of its readability works as a glue with AI.

It's related to flowchart in a way we write algorithms, for eg. in python we rarely use counter in for loop the inverse is thus C++ where most for loops are for loops not for each loops.

Hope this helps.

3 0
4 years ago
To delete a comment, right click the comment and then select the ____ command.
aleksandrvk [35]

delete command is your answer i tink

8 0
3 years ago
Read 2 more answers
Write three guidelines to help you keep track of your behavior as you use different apps with
Gala2k [10]

Answer:

A basic guideline plan to help me track my behavior consist of the following:

How much time do I use each element?

Have I experienced anxiety after using them?

Have I experienced anxiety while using them?

Have I changed my day to day routine by using them?

Explanation:

The reasons to back my answer are the following. First of all, dependency can be measured in time spent and anxiety developed after the use of the element. Thus, we need to explore if the source of media has originated anxiety while using it or after using t to spot if we are suffering an addictive pattern. Also, generally addictive elements create anxiety while using it and it increases after stop using them. Therefore, if we find that we have experienced both types of anxiety we are in an addictive cycle.

4 0
3 years ago
Other questions:
  • A method in a class that modifies information about an object is called a/an ____ method.
    14·1 answer
  • Advantage and disavantage of malware maintenance
    12·1 answer
  • Grouping data in a report will (Points : 4) provide grand totals for your report.
    8·1 answer
  • Which fact does lean green eco machines present to show that electric cars are not perfect
    13·2 answers
  •  In which part of a professional email should you try to be brief, but highly descriptive? 
    10·1 answer
  • Question 4 Multiple Choice Worth 5 points)
    6·1 answer
  • Suppose that the following elements are added in the specified order to an empty binary search tree: Kirk, Spock, Scotty, McCoy,
    12·1 answer
  • Lindsey also needs to calcite the commissions earned each month. If the company earns $200,000 or more in a month, the commissio
    5·1 answer
  • If you see these REPORT.
    14·2 answers
  • This computer is used by touching your finger.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!