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
SSSSS [86.1K]
3 years ago
9

_____ selectors are used to select elements based on elements that are adjacent to them in the document hierarchy.

Computers and Technology
1 answer:
Bezzdna [24]3 years ago
3 0

Answer:

Sibling

Explanation:

  • Sibling elements that share the same parents are adjacent to each other
  • The basics are one level higher
  • The last item on the childless hierarchy is decent.
  • The child is the immediate next item
  • so correct answer is sibling
You might be interested in
The ultimate purpose of the Building an economic model is to?
Montano1993 [528]
The correct answer is C 
4 0
3 years ago
Read 2 more answers
what do we know about the contents of the arrays left and right with respect to what objects (integers) they contain in general
KIM [24]

A "divide and conquer" approach known as binary search necessitates sorting the starting array first. Because the technique divides the array into two equal halves, it is called a binary algorithm. A binary search will initially examine the middle item in the array and evaluate it in relation to the search terms.

<h3>What exactly is binary search?</h3>
  • Finding an element's location in a sorted array can be done using the searching method known as binary search.
  • With this method, an array's middle is always searched for the element. Only on a list of things that has been sorted can binary search be used. If the elements are not sorted already, we need to sort them first.
  • Binary search is used to find values in any sorted collection from any language library, including Java,.NET, C++ STL, etc.
  • A sorted array can be searched using the binary search algorithm by continually halving the search interval. Utilizing the knowledge that the array is sorted, binary search attempts to minimize the time complexity to O (Log n).

To Learn more about binary search refer:

brainly.com/question/21475482

#SPJ4

3 0
1 year ago
Write a C program to multiply matrix A and matrix B of variable. For both A and B, the size of the matrix will be given along wi
victus00 [196]

Answer:

<u><em>Code:</em></u>

    #include <iostream>

    #include <fstream>

    #include <cctype>

    #include <cmath>

    #include <vector>

    #include <float.h>

   

    using namespace std;

   

    typedef vector<vector<double> > C2DArray;

   

    void Matrix_Mult(bool* error_flag, const int mRows, const int nCols, const int pCols, const C2DArray A_Matrix, const C2DArray B_Matrix, C2DArray& C_Matrix) {      

     int i = A_Matrix.size(), j = A_Matrix[0].size(), k = B_Matrix[0].size();

     double dummy;

     if ((j != B_Matrix.size()) || (i != mRows) || (j != nCols) || (k != pCols))  *error_flag = true;

   

     if ((C_Matrix.size() != i) || (k != C_Matrix[0].size()))  *error_flag = true;

   

     if (!(*error_flag)){

     for (k = 0; k < mRows; k++) { // Do each row of A with each column of B

      for (i = 0; i < pCols; i++) {

       dummy = 0.0;

       for (j = 0; j < nCols; j++) {

        dummy += A_Matrix[k][j]*B_Matrix[j][i];

          } // End for j

          C_Matrix[k][i] = dummy;

      } // End for i

     } // End for k

     }

   

        return;

    } // End Matrix_Mult

   

    int main()

    {char rflag = 0; //Readiness flag  

   

    cout << "                 Mat_Mul1 (7 June 2013)\n";

    cout << "=========================================================================== \n";

    cout << "This program multiplies two matrices, [A] and [B]: [A][B] = [C].\n";

    cout << "[A] is M X N, [B] is N X P, and [C] is M X P\n";

    cout << "The dimensions of the [A] and [B] matrices, M, N, and P, should \n";

    cout << "have been saved beforehand in a file named mulmatdat.\n";

    cout << "mulmatdat should be in the same folder as the Mat_Mul1 executable.\n";

    cout << "The next values of mulmatdat should be the entries for matrix [A],\n";

    cout << "with data for row 1 first, then row 2, then row 3, etc.\n";

    cout << "The entries for the [B] matrix should follow, in the same order.\n";

    cout << "\nThe data is assumed to be of type double. Variables used within this program\n";

    cout << "are type double.\n";

    cout << "\nThe output is written to the file mulmatout.txt.\n";

   

    cout << "\nIs everything ready (are you ready to continue?)? If yes, Enter y. \n";

    cout << "Otherwise Enter any other key. \n";

    cin >> rflag;

   

    if (toupper(rflag) == 'Y') {

    C2DArray A, B, C; // A, B, and C Matrices

    int i, j, mDim, nDim, pDim; // Array index variables and matrix dimensions

    bool erFlag = false;  // Error flag

   

    ifstream in("mulmatdat.txt", ios::in);

   

    if (!in) {

            cout << "\nCannot open the input file.\n";

         cout << "\nEnter any key to continue. \n";

         cin >> rflag;

            return 0;

    }

   

    in >> mDim >> nDim >> pDim; //Input the Matrices' dimensions from the file

     

    if ((mDim < 1) || (nDim < 1) || (pDim < 1)){

            cout << "\nInvalid dimension entered. Program terminated. \n";

         cout << "\nEnter any key to continue. \n";

         cin >> rflag;

            in.close(); //Close the input file before terminating

            return 0;

    }

   

    ofstream out("mulmatout.txt", ios::out);

    if (!out) {

            cout << "\nCannot open the output file. Program terminated.\n";

         cout << "\nEnter any key to continue. \n";

         cin >> rflag;

            in.close(); //Close the input file before terminating

            return 0;

    }

   

    // Beginning of try block, if vector re-sizing unsuccessful

    try {

   

           // Resize the arrays to the appropriate sizes

            A.resize(mDim); // M rows

         B.resize(nDim); // N rows

         C.resize(mDim); // M rows

            for (i = 0; i < mDim; i++){

               A[i].resize(nDim); // M columns

            C[i].resize(pDim); // P columns

            } // End for i

   

         for (i = 0; i < nDim; i++){

               B[i].resize(pDim); // P columns

            } // End for i

   

    } // End of try block

   

    catch (bad_alloc& xa) { // Catch block, for exceptions

   

            in.close();

            out.close();

            cerr << "\nIn catch block, so an exception occurred: " << xa.what() << "\n";

            cout << "\nEnter any key to continue. \n";

            cin >> rflag;

            return 0;

   

    } // End of catch block

   

    for (i = 0; i < mDim; i++){ //Input the A Matrix from the file

            for (j = 0; j < nDim; j++){

              in >> A[i][j];

            }//End for j

    }//End for i

   

    for (i = 0; i < nDim; i++){ //Input the B Matrix from the file

            for (j = 0; j < pDim; j++){

             in >> B[i][j];

            }//End for j

    }//End for i

   

    in.close(); //Close the input file

   

    Matrix_Mult(&erFlag, mDim, nDim, pDim, A, B, C);

   

    if (erFlag){

      cout << "Inconsistent data sent to Matrix_Mult routine. Matrix multiplication NOT performed. Check data before running again.\n";

    }

    else {

   

     out.precision(DBL_DIG);

   

     out << "\nThe A matrix follows:\n";

     out << "\n";

     for (i = 0; i < mDim; i++){

      for (j = 0; j < nDim; j++){

     out << A[i][j] << " ";

      } // End for j

      out << "\n";

     }//End for i

   

     out << "\nThe B matrix follows:\n";

     out << "\n";

     for (i = 0; i < nDim; i++){

      for (j = 0; j < pDim; j++){

     out << B[i][j] << " ";

      } // End for j

      out << "\n";

    }//End for i

   

     out << "\nThe product matrix, C, follows:\n";

     out << "\n";

     for (i = 0; i < mDim; i++){

      for (j = 0; j < pDim; j++){

       out << C[i][j] << " ";

      } // End for j

      out << "\n";

     }//End for i

   

     cout << "\nDone! The solution is in the text file mulmatout.txt \n";

    } // End else !erFlag

    out.close();

    }

    else cout << "\nNot ready. Try again when ready with information. \n";

    cout << "\nEnter any key to continue. \n";

    cin >> rflag;

    return 0;

    }

<u><em></em></u>

4 0
4 years ago
Which sentence is correctly punctuated? WILL GIVE YU MONEY GIVE ME YOUR CASH APP PLS
Genrish500 [490]
The third one is best in me owns opinion
3 0
3 years ago
Read 2 more answers
A friend of Alex has gifted a movie collection, and Alex is excited to watch them all as quickly as possible. The duration of th
marishachu [46]

To find out the duration of alex's movies, you can use the code in C++ to make this calculation, where you will only need the number of movies and their duration, as well:

<h3>Writing code in C++:</h3>

<em>#include<bits/stdc++.h></em>

<em>using namespace std;</em>

<em>struct Movie {</em>

<em>   int timeBegin, duration, timeEnd;</em>

<em>   bool operator<(const Movie& another) const {</em>

<em>      return timeEnd < another.timeEnd;</em>

<em>   }</em>

<em>};</em>

<em>struct Festival {</em>

<em>   int count;</em>

<em>   vector<Movie> movies;</em>

<em>};</em>

<em>Festival* initialize(int timeBegin[], int duration[], int count) {</em>

<em>   Festival* filmFestival = new Festival;</em>

<em>   filmFestival->count = count;</em>

<em>   for (int i = 0; i < count; i++) {</em>

<em>      Movie temp;</em>

<em>      temp.timeBegin = timeBegin[i];</em>

<em>      temp.duration = duration[i];</em>

<em>      temp.timeEnd = timeBegin[i] + duration[i];</em>

<em>      filmFestival->movies.push_back(temp);</em>

<em>   }</em>

<em>   return filmFestival;</em>

<em>}</em>

<em>int solve(Festival* fest) {</em>

<em>   int res = 0;</em>

<em>   sort(fest->movies.begin(), fest->movies.end());</em>

<em>   int timeEnd = -1;</em>

<em>   for (int i = 0; i < fest->count; i++) {</em>

<em>      if (fest->movies[i].timeBegin >= timeEnd) {</em>

<em>         res++;</em>

<em>            timeEnd = fest->movies[i].timeEnd;</em>

<em>      }</em>

<em>   }</em>

<em>   return res;</em>

<em>}</em>

<em>int main(int argc, char *argv[]) {</em>

<em>int timeBegin[] = {1, 3, 0, 5, 5, 8, 8};</em>

<em>int duration[] = {3, 2, 2, 4, 3, 2, 3};</em>

<em>Festival * fest;</em>

<em>fest = initialize(timeBegin,duration, 7);</em>

<em>cout << solve(fest) << endl;</em>

<em>return 0;</em>

<em>}</em>

See more about C Code at brainly.com/question/17544466

#SPJ1

8 0
2 years ago
Other questions:
  • All of the following items could be too expensive for someone with only a high school degree to afford except
    6·1 answer
  • To close a window in Windows 10, you can _____. Select all that apply. A. right-click its button on the taskbar, then click Clos
    11·1 answer
  • Create a security management policy that addresses the management and the separation of duties throughout the seven domains of a
    6·1 answer
  • Which of the following is an example of constructive criticism for a friend who speaks too softly?
    13·2 answers
  • 1) In your own words, explain what a browser is. 2) Why is it important to keep your browser up to date?
    12·1 answer
  • ¿Que es lo que hace tan especial a la tarjeta de video NVIDIA 1080Tt?
    15·1 answer
  • When you see ####### in a cell, you should​
    11·1 answer
  • Write a program to help a local restaurant automate its breakfast billing system. The program should do the following:
    11·1 answer
  • What is the function of ROM?
    10·1 answer
  • What is the difference between a computer’s RAM and its hard disk?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!