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
Arturiano [62]
4 years ago
10

The ____ algorithm tries to extend a partial solution toward completion

Computers and Technology
1 answer:
Fittoniya [83]4 years ago
8 0

Answer: Backtracking

Explanation:

Backtracking algorithm approaches a solution in a recursive fashion whereby it tries to build answers and modify them in time intervals as we progress through the solution. One such backtracking algorithm is the N Queen problem whereby we place N Queen in a chessboard of size NxN such that no two queens attack each other. So we place a queen and backtrack if there is a possibility that the queen is under attack from other queen. This process continues with time and thereby it tends to extend a partial solution towards the completion.

You might be interested in
One of the functions of an IDE is to check for: flowchart errors. Syntax errors. memory errors X input and output.​
scoundrel [369]

Answer:

flowchart errors

Explanation:

5 0
3 years ago
Read 2 more answers
Python will ignore any line of code that begins with hashtag true or false​
fgiga [73]

Answer:

True

Explanation:

Yes

3 0
3 years ago
Read 2 more answers
What is a WYSIWYG program?
DanielleElmas [232]
D will be the answer a program that allows you to take a tutorial on html terminology
5 0
3 years ago
Read 2 more answers
I want to solve this question in C program, Please.
inn [45]

Answer:

#include <stdio.h>

#include <math.h>

int is_armstrong(int n) {

int cubedSum = 0;

int r = n;

while (r) {

         cubedSum += (int)pow(r % 10, 3);

          r = r / 10;

}

return cubedSum == n;

}

int stack_count(int n) {

int sum = 0;

while (n) {

         sum += n % 10;

         n = n / 10;

}

return sum;

}

int is_magical(int n) {

while (n > 9) {  

 n = stack_count(n);

 printf("%d ", n);

}

return n == 1;

}

int main()

{

int input = 0;

int isMagical, isArmstrong;

while (true) {

 printf("Enter a number: ");

 scanf_s("%d", &input, sizeof(int));

 if (input == -1) break;

 isArmstrong = is_armstrong(input);

 isMagical = is_magical(input);  

 if (isArmstrong && isMagical) {

  printf("%d is both an armstrong and a magical number.\n", input);

 } else if (isArmstrong) {

  printf("%d is an armstrong number\n", input);

 } else if (isMagical) {

  printf("%d is a magical number\n", input);

 } else {

  printf("%d is neither an armstrong or a magical number.\n", input);

 }

}

}

Explanation:

Here is a starting point. What's the definition of a magical number?

4 0
3 years ago
You are to write a program that performs basic statistical analysis on a 500 element array of integers. Your program should incl
mrs_skeptik [129]

Answer:

#include <iostream>  

#include <cstdlib>  

#include <ctime>  

using namespace std;

int* generateArray(int size)  

{

 int *numbers = new int[size];

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

   numbers[i] = (rand()%100) + 10;

 }

 return numbers;  

}

int findMode(int *arr, int size)  

{

 int countMode = 0;

  int mode ;

 int count;

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

    count = 1;

   for(int j=i+1;j<size;j++) {

     if(arr[j] == arr[i] ){

       count++;

      }

     if(count > countMode) {

        countMode = count;

       mode = arr[i];

     }

   }

}

 return mode;

}  

int findMedian(int *arr, int size)  

{

  sort(arr,size);

  int median;

   if(size%2 == 0){

   median = (arr[int((size-1)/2)]+arr[size/2])/2;

 } else{

     median = arr[(size-1)/2];

 }

 return median;

}

void sort(int *arr, int size)

{

 int min;

  for(int i=0;i<size-1;i++) {

    min = i;

    for(int j=i+1;j<size;j++){

     if(arr[j] < arr[min]){

       min = j;

     }

     if(min != i) {

       int temp = arr[i];

       arr[i] = arr[min];

       arr[min] = temp;

     }

   }

 }

}

int main()  

{

 srand(time(0));  

 int size = 501;    

 int *numbers = generateArray(size);

 cout<<"Mode : "<<findMode(numbers,size)<<endl;

 cout<<"Median : "<<findMedian(numbers,size)<<endl;  

 return 0;  

}

 

Explanation:

The C++ program is able to generate 500 integer items into the defined array and statistically analyze and provide the average and modal number in the array of integer dataset.

3 0
3 years ago
Other questions:
  • Max magnitude Write a method maxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the
    13·1 answer
  • 6. When you don't have enough room to stop, you may _______ to avoid what's in front of you.
    14·1 answer
  • In the FEMA case study, the BureauNet software was the primary reason behind the increased speed and relevance of the reports FE
    15·2 answers
  • Which are the two alternatives for pasting copied data in a target cell or a group of cells ?
    13·2 answers
  • Which of the following is true about ISO___________.
    5·1 answer
  • The Analytics tracking code can collect which of the following? (select all answers that apply) (1)-Language the browser is set
    15·1 answer
  • Suponiendo que el centro de la gravedad de la barra se enchentra a 3 m del punto de apoyo,y su contrapeso, de 4800 N, se encuent
    14·1 answer
  • Which format has the largest file size?
    10·1 answer
  • In C Coding, print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unkn
    10·1 answer
  • Shreya has combined all the cells in a single leftmost column in a table. Instead of identifying the category multiple times, sh
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!