AD3251 UNIT1 FLASHCARDS
27 flashcards · Computer Science · by Er.R. Sathish
A mathematical-model with a collection of operations defined on that model is called Abstract Data Type
Representation of data structure in memory
A stack is an ordered collection of items that follows the LIFO principle.
A queue is an ordered collection of items that follows the FIFO principle.
Linked list stores ordered collection of elements
Data structure is used for implementing recursion called Stack
A class is an abstract plan for creating more particular, specialised items.
Encapsulation - containing information in an object, exposing only selected information
Abstraction - only exposing high level public methods for accessing an object
Objects - Collections of data and procedures that are grouped into single, reusable entities.
Polymorphism - objects can adopt more than one form, depending on their context
Define Datatype:
A data type is a classification of data that tells the compiler or interpreter how the programmer intends to use the data.
List the data types in python
Which inbuilt function in python can be used to identify the data type of the value or variable?
type() Eg: >>>val1=10 >>>print(type(val1)) <class int>
Abbreviate ADT
Abstract Data Type
Define Abstract Data Type
An abstract data type is a set of operations. ADTs are mathematical abstractions; nowhere in an ADT’s definition is there any mention of how the set of operations is implemented. Objects such as lists, sets and graphs, along with their operations can be viewed as abstract data types.
Categorize the different Programming Languages.
Procedural Programming Functional Programming Object-Oriented Programming Scripting Programming Logic Programming
What are the major features of OOP?
Class Object Abstraction Encapsulation polymorphism Inheritance
What is an object?
An Object is an identifiable entity with some characteristics and behaviour. An Object is an instance of a Class. Objects can correspond to real-world objects or an abstract entity.
What is a class?
Classes are user-defined data types that act as the blueprint for individual objects, attributes, and methods.
What are the benefits of OOP?
Modularity Reusability Productivity Easily upgradable and scalable Interface description Security Flexibility
What is abstraction?
Abstraction is selecting data from a larger pool to show only relevant details of the object to the user.
Define Encapsulation.
Encapsulation is a concept of bundling data-related variables, properties, and methods in one class.
What is inheritance?
Inheritance describes is a kind of relationship between two or more classes, abstracting common details into super class and storing specific ones in the subclass.
List the types of inheritance.
Single Inheritance Multilevel Inheritance Hierarchical Inheritance Multiple Inheritance Hybrid Inheritance
Which among the following best defines single level inheritance? a) A class inheriting a derived class b) A class inheriting a base class c) A class inheriting a nested class d) A class which gets inherited by 2 classes
d) A class which gets inherited by 2 classes
Members which are not intended to be inherited are declared as ________________ a) Public members b) Protected members c) Private members d) Private or Protected members
c) Private members
If a derived class object is created, which constructor is called first? a) Base class constructor b) Derived class constructor c) Depends on how we call the object d) Not possible
a) Base class constructor