CS 1400 exam

24 flashcards · Computer Science · by Elsa Schutfort

  1. A ___ is a template or blueprint that is used to create a ___ of the same type

    class and object

  2. Used to create an instance of a class

    constructor

  3. The name of the method that is defined to customize an object, and is automatically called when an instance of a class is created

    __init__

  4. UML

    a way to diagram classes to give a visual representation

  5. self

    Used as the first formal parameter of an instance method

  6. Access Operator symbol

    .

  7. method

    def getMultiple(self, insert): return insert

  8. local variable

    def insert(self): multiplier = 8 return insert

  9. setter

    a method created in order to change private data so that in can be used

  10. Private method

    def __insert(self): self.value += 10

  11. len

    the name of the built-in function that will return the number of characters in a string or the number of elements in a list

  12. Operator Overloading

    makes it possible to use integer division (//) symbol on an object

  13. __sub__

    method that can be defined to change the meaning of minus symbol

  14. interning

    if there are a few string variables whose values are the same

  15. Are Strings and Numbers immutable, but Lists are mutable

    Yes

  16. Is x = "Apple", "Banana", "Cherry" a list?

    No

  17. What does append do?

    adds a number to a list

  18. What does pop do?

    removes something from the list

  19. index operator

    [ ]

  20. == operator

    True if strings are the same and False if strings are different... id's do not effect operator

  21. pop

    method that removes and returns an element from a list

  22. Insertion Sort

    spilt into a sorted and unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.

  23. Binary Search

    search method that eliminates half of the possibilities after each iteration of the search loop

  24. Scan all number, keeping track of value and location of smallest so far, update when find something smaller

    Selection Sort