Knowledge check: Advanced data structures
11. Given an array of 12 numbers -> 1,45,5,34,23,5,82,12,35,21,8,9
And a hashing function modulus 6. How many collisions would you expect to have in your table?
- 7
- 6
- 4
- 5Â
12. What data structure would be most suitable for mimicking the actions of a hashtable?
- Queue
- Dictionaries
- Stack
13. What value is stored at the root of a min_heap?
- The last inserted value
- The lowest value
- The highest value
14. Why is the travelling salesman used in graphs?
- Because the analogy of travelling can be related to the number of connected nodes.
- Because the distance between two nodes reflects distance in real life.
- Because graphs store information in a fixed way so that every node is the exact same distance apart. Allowing us apply travel times to it.
15. In relation to computer science what is a clique?
- It is a social group that one actively engages with.
- It is a subset of a graph that has found to have strong internal connections and weak external ones.
- It is a memory feature that allows for quick lookup of one’s social circle.
Module quiz: Introduction to data structures
17. Arrays are always stored on the stack?
- Yes, but only through making a shallow-copy.
- Yes, but only through making a deep-copy.
- No
18. What happens when you try to retrieve a value using a number greater than the index size?
- It would return a warning and a message indicating the issue.
- It would throw an error.
- Nothing. There would be nothing to retrieve so it would return null.
Shuffle Q/A 2
19. In relation to computer science, what is a class?
- It is the thing from which arrays are build.
- It is a blueprint for an object.
- An object that has functionality.
20. In relation to objects, what are instance variables?
- Attributes that can take on many forms.
- Characteristics of the class.
- An attribute that has an immediate impact when compiled.