subject

Time complexity gives a rough idea of how long it will take for an algorithm to execute based on two things: the size of the input it has and the amount of steps it takes to complete,

whereas space complexity is also the amount of memory required to execute an algorithm based

on the size of input it has or given.

Using mathematical notations or diagrams critically explain the time and space complexity of the

code below. 10 marks

int a = 0;

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

for (j = N; j > i; j--) {

a = a + i + j;

}

}​

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:00, Julianhooks
State 7 common key's for every keyboard
Answers: 1
image
Computers and Technology, 23.06.2019 23:40, lexiecooley
4. what is the reason for including the following code snippet in the header file animal. h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
image
Computers and Technology, 24.06.2019 07:40, daebreonnakelly
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
image
Computers and Technology, 24.06.2019 11:20, tiffanibell71
Colby works as a shipping clerk for a major package delivery service. some of his daily tasks include tracking shipments and entering orders. which aspect of the information technology cluster would he most likely be trained in? a. networkingb. databasesc. hardwared. software
Answers: 2
You know the right answer?
Time complexity gives a rough idea of how long it will take for an algorithm to execute based on t...

Questions in other subjects:

Konu
Mathematics, 20.04.2020 02:59
Konu
Mathematics, 20.04.2020 02:59