INAL CSC1 21 SPRING 1 Name: 1.(Spts) What is the missing keyword teeplate Jpedan
ID: 662449 • Letter: I
Question
Explanation / Answer
===========================================================
1. What is the missing keyword?
template
Ans:
----
template <typename T>
Explantion:
-----------
For a template ,it should have its typename.
typename includes primitive datatypes int ,char etc. or class.
===========================================================
2. In which file do we write class template defination?
Ans:
----
header file
Explantion:
-----------
class defination must be written in header file.
The file should be stored with .h extension.
===========================================================
3. Function calls are store on the ___?
Ans:
----
stack
Explantion:
-----------
The function calls are stored on the stack.
For each step of fuction an entry made into the stack.
Once the excution of function completed pop out the data.
===========================================================
4. A __ tree has at most two children per node?
Ans:
----
Binary Tree
Explantion:
-----------
Binary tree is a tree data structure in which each node has at most two children,
which are referred to as the left child and the right child.
===========================================================
5. _______ happens when a function call itself?
Ans:
----
Recursion
Explantion:
-----------
A function called it self is called recusion.
===========================================================
6. The class we inherit from is called ____ class.
Ans:
----
Base class /Parent class
Explantion:
-----------
The class we inherit is called as Base class/ Parent class.
===========================================================
7. The top node in a tree is called the _______
Ans:
----
root
Explantion:
-----------
The top node in a tree is a root node.
===========================================================
8. We _______ data off a stack.
Ans:
----
Pop
Explantion:
-----------
Generally we pop data from a stak untill it is empty.
===========================================================
9. A _____ node doesnt have any children.
Ans:
----
leaf node
Explantion:
-----------
Tree nodes that have no children are called leaf nodes.
===========================================================
10. Calling functions endlessly will eventually cause _____
Ans:
----
Infinite loops
Explantion:
-----------
Endless loop that eventually will cause a infinite loops and it is panic
because you will run out of memory.
===========================================================
11. A _____ node has atleaset 1 child.
Ans:
----
Internal node
Explantion:
-----------
A node with at least one child is an internal node.
===========================================================
12. We _____ data onto a stack.
Ans:
----
Push
Explantion:
-----------
Generally we push data onto a stak untill it is fulled.
===========================================================
13. A ____ is a STL container that acts like a dynamic array.
Ans:
----
vector
Explantion:
-----------
vector is a STL container which defines a dynamic array.
===========================================================