Preview

02 - Timewise and Spacewise comparison

 1. An algorithm is a step-by-step set of instructions to solve a specific problem and it is important to understand that the same problem can be solved with a variety of algorithms

  FALSE

  TRUE

 2. In order to decide which algorithm to chose over another, they are compared in terms of their efficiency: the time it takes to find the solution and the _______________________

  length of the code

  type of programming language that is used

  people that are involved in the process

   resources which are consumed in the process

 3. This refers to the amount of (memory) that the algorithm will take up before it terminates with the correct solution

  Time-wise efficiency

  Linear efficiency

  Space-wise efficiency

  Big O efficiency

 4. In order to identify the space-wise efficiency we need to look at the amount of ______________ used as the algorithm is running

  comments

  data structures

  lines of code

  variables

 5. When considering space-wise efficiency, the aim is to utilise data structures which take up the most amount in memory.

  FALSE

  TRUE

 6. Initialising an array with a length of 1000 will be highly space-wise efficient, when it is clear that the maximum elements to be stores will be 100

  TRUE

  FALSE

 7. Populating a list with variables of type real will be space-wise inefficient, when it is clear that only whole numbers (integers) will ever be needed to solve the problem.

  FALSE

  TRUE

 8. This is the amount of time it takes for the algorithm to terminate with the correct solution.

  Time-wise efficiency

  Linear efficiency

  Space-wise efficiency

  Big O efficiency

 9. Note that time complexity is all about how the time it takes changes when you change the size of the input. It's not about how fast it is with data of the same size.

  FALSE

  TRUE

 10. It is possible for two algorithms to have the same time complexity but a different space complexity

  TRUE

  FALSE