5 Written questions
5 Matching questions
- What is a doubly linked list?
- What does the function (cons item list) do?
- To make an Integer out of an int, what should be used?
- What is the Big O of accessing some element in the middle of a LinkedList?
- What will a filter function do?
- a It makes a new list element containing item, and adds it to the front of list
- b It has pointers that point both forward and backward
- c O(N)
- d Integer myInteger = Integer.valueOf(myInt);
Integer myInteger = myInt; // autoboxing
- e Filter removes items from a Collection if they meet a certain condition
5 Multiple choice questions
- First can be any Object type, while rest is a Cons or null
- The max of the Big O of the test, then statement, and else statement
- It makes a new linked list whose elements are in reverse order of the original list
5 True/False questions
What are contents of a linked list? → getFirst, addFirst, removeFirst, getLast, addLast, removeLast are all O(1)
What is a circularly linked list? → The last link points back to the front of the list rather than to null or nil
What does the function assoc do? → It concatenates two lists to form a single list; it does so by modifying the end of the first list to point to the second list
For reference types, what do == and != test? → The equality of pointer values (i.e. do they have the exact same data address in memory?)
How big is a pointer? → 64 bits on modern machines.