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 _______________________

  type of programming language that is used

  length of the code

   resources which are consumed in the process

  people that are involved in the process

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

  Linear efficiency

  Space-wise efficiency

  Big O efficiency

  Time-wise efficiency

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

  lines of code

  comments

  data structures

  variables

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

  TRUE

  FALSE

 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

  FALSE

  TRUE

 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.

  Linear efficiency

  Time-wise 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.

  TRUE

  FALSE

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

  TRUE

  FALSE