chapter 1 Flashcards
What is an Abstract Data Type?
A data type in which you do not know how it works under the hood but you can interact with its interface and you know its methods. E.g. You don’t know how an array works but you know how to access an element
What is Abstraction?
Abstraction is the process of hiding the inner workings of something so that the user is left with a succinct and high level overview of the item. Only necessary features shown
What is an algorithm?
An algorithm is a finite sequence of steps which once executed solve a problem
What is a Class?
A class is a representation(blueprint) of an object(a particular data structure) which contains ways to interact with it(methods). It contains a constructor which initialises the object which can take parameters. The initial parameters are called attributes.
What does Computable mean?
It means that a problem is able to be solved
What is data abstraction?
The process of hiding certain details and showing only essential information to the user. It deals with the level of complexity in data systems.
What is a data structure?
A data structure is a form of an Abstract Data Type in which the user is presented with a high level view of a way in which data can be stored, with various ways(methods) to interact with it. It is a way of organising data efficiently
What is a data type?
A data type, also called an atomic data type, is binary code translated in a way that the user can understand what it is. There are many different types such as integers, characters, floats etc which also distinguish what operations can be performed on the data.
What is Deep Equality?
Refers to when two objects are the same based on their contents and their structure
What is a dictionary?
Also called a hash table, it is a data structure in which values have a corresponding key which are used to access the value. They are non sequential and unordered.
What is encapsulation?
Also called information hiding it is the bundling of data with the methods that operate on that data. It restricts direct access to some of an object’s components, which is a means of preventing accidental interference and misuse of the methods and data.
What is an exception?
Also called a logic error, it is raised when there is a problem in the programs code generated by the user which will halt the execution of a program. Can be raised purposefully by a user
What is a format operator?
A special operator (often % in many languages) used to format strings with variables or expressions.
print(“%s is %d years old.” % (aName, age))
the small characters correspond to a specific data type e.g. d == integer
What is a formatted string?
A formatted string is a template in which words or spaces that will remain constant are combined with placeholders for variables that will be inserted into the string
e.g. f strings in python
Define a “HAS-A” relationship
A relationship between objects in which one object is a part of another. One object contains another, possibly in its constructor or by another class instant being a parameter of another class