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
Papessa [141]
3 years ago
6

Se Statements

Computers and Technology
1 answer:
Alla [95]3 years ago
8 0

Answer:

23

Explanation:

You might be interested in
Consider designing a program where you need to store information about every student ASU. You need to be able to quickly determi
gulaghasi [49]

Answer:

Check the explanation

Explanation:

Both Arrays and Linked List can be used to store linear data of similar types, but they both have some advantages and disadvantages over each other. To store information about every student we can use an array

Reason:

In the array the elements belong to indexes, i.e., if you want to get into the fourth element you have to write the variable name with its index or location within the square bracket.

In a linked list though, you have to start from the head and work your way through until you get to the fourth element.

Accessing an element in an array is fast, while Linked list takes linear time, so it is quite a bit slower.

Example: store the data of students and have faster access and this program in example also do sorting

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

// struct person with 3 fields

struct Student {

   char* name;

   int id;

   char age;

};

// setting up rules for comparison

// to sort the students based on names

int comparator(const void* p, const void* q)

{

   return strcmp(((struct Student*)p)->name,

                 ((struct Student*)q)->name);

}

// Driver program

int main()

{

   int i = 0, n = 5;

   struct Student arr[n];

   // Get the students data

   arr[0].id = 1;

   arr[0].name = "bd";

   arr[0].age = 12;

   arr[1].id = 2;

   arr[1].name = "ba";

   arr[1].age = 10;

   arr[2].id = 3;

   arr[2].name = "bc";

   arr[2].age = 8;

   arr[3].id = 4;

   arr[3].name = "aaz";

   arr[3].age = 9;

   arr[4].id = 5;

   arr[4].name = "az";

   arr[4].age = 10;

   // Print the Unsorted Structure

   printf("Unsorted Student Records:\n");

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

       printf("Id = %d, Name = %s, Age = %d \n",

              arr[i].id, arr[i].name, arr[i].age);

   }

   // Sort the structure

   // based on the specified comparator

   qsort(arr, n, sizeof(struct Student), comparator);

   // Print the Sorted Structure

   printf("\n\nStudent Records sorted by Name:\n");

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

       printf("Id = %d, Name = %s, Age = %d \n",

              arr[i].id, arr[i].name, arr[i].age);

   }

   return 0;

}

Output:

Unsorted Student Records: Id = 1, Name = bd, Age = 12 Id = 2, Name = ba, Age = 10 Id = 3, Name = bc, Age = 8 Id = 4, Name = aaz, Age = 9 Id = 5, Name = az, Age = 10

6 0
4 years ago
What is the difference between science and technology how are they related
Nina [5.8K]
The Malawian in science are connected because of the echo system it's crossed the wrong way and they connect to each other
5 0
4 years ago
Task Instructions
Reil [10]

Answer:

= B9 + B10 - E8

Explanation:

Required

Create a formula in E10 that subtracts E8 from the sum of B9 and B10

The sum of B9 and B10 is represented with B9 + B10

When E8 is subtracted, the formula becomes B9 + B10 - E8

To write a formula in Excel, you start with " = " sign.

So, type the following in cell E10

<em>= B9 + B10 - E8</em>

<em />

<em>The cell references in this case are the name of the cells; i.e. B9, B10 and E8</em>

7 0
3 years ago
Help Menu is available at which button in the keyboard?
kvasek [131]
Answer: It should be F1.
6 0
4 years ago
Match the type of energy with it's correct description
lesya [120]
This is the energy that all moving objects have.
potential energy

This is the type of energy that is given off as a result of electrons (charges!) moving through a conductor.


This is the energy of motion and position - Kinetic Energy and Potential Energy are included here.
Kinetic Energy + Potential Energy = Mechanical Energy

This is energy that is transmitted through vibrations.
Sound Energy

This is stored energy, waiting to be used!
Kinetic Energy

This is the only form of energy we can see with our eyes!
Light Energy

This is heat energy! It can be transferred through conduction, convection, or radiation.
Thermal Energy
8 0
3 years ago
Other questions:
  • Which function of a web page relies on responsive web design
    14·1 answer
  • 6.
    15·1 answer
  • "The correct syntax for passing an array as an argument to a method when a method is called and an array is passed to it is: "
    15·1 answer
  • The Occupational Outlook Handbook is published by the Bureau of Labor Statistics.
    10·2 answers
  • If the ____________ is broken on a laptop, chances are other parts are also broken.
    5·1 answer
  • 2. Write a standalone function partyVolume() that takes accepts one argument, a string containing the name of a file. The object
    14·1 answer
  • Which option represents the location of the Goal Seek function?
    8·2 answers
  • Draw a flowchart or write pseudocode to represent a program's logic that allows the user to enter a value. The program multiplie
    5·1 answer
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    8·1 answer
  • Comment suprimer son compte brainly
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!