T4Tutorials .PK

VU Past Papers CS301 – Computer Science FAQ – Updated Version

 FAQ (Updated Version)

Q: Define Abstract Base Class
A: A class that defines an interface in C++; cannot be instantiated. All derived classes must implement its methods.

Q: What is an Instance?
A: An allocated object of a class. Each instance has its own data.

Q: Define Concrete Class
A: A non-abstract class that can be instantiated.

Q: Name the Properties of a Binary Tree
A: Fullness, Balance, Leftness

Q: Define Binary Search Tree (BST) with Example
A: BST is a binary tree for efficient searching: left subtree < node < right subtree. Example: searching in 1000 items vs linear search.

Q: Define Heap
A: 1. Memory for dynamic structures during runtime.
2. Complete binary tree where parent’s value ≥ or ≤ children.

Q: Define Binary Tree
A: Tree with max two children per node; used in searching, compression, and parsing.

Q: Differentiate Database, Data Communication, and Data Structure

Q: 32-bit vs 16-bit Programming
A: 16-bit uses 16-bit registers (obsolete); 32-bit uses 32-bit registers (current for Windows apps). 64-bit exists for certain architectures (e.g., Sun Sparc).

Q: Pseudo Code vs Algorithm

Q: What is an External Node?
A: Node with no children (leaf node).

Q: How Data Compression Works?
A: Reduces size of data while preserving accuracy.

Q: Greedy Algorithm vs Huffman Algorithm

Q: Formula for Min Nodes in AVL Tree
A: N(h) = N(h-1) + N(h-2) + 1, N(0)=1, N(1)=2; Operations in O(log N) time.

Q: Difference Between Paging and Virtual Memory

Q: Transient Object
A: Object whose lifetime cannot exceed the application; can be deleted anytime.

Q: Stack Usage in Hardware

Q: Generic Data Type
A: Type determined at usage (C++ templates).

Q: Binary, Unary, Operand

Q: Why Not Use Parentheses in Postfix
A: Postfix operator comes after operands; no need for precedence override.

Q: Notations

Q: Difference Between .h and .cpp

Q: Standard Template Library (STL)
A: Collection of reusable containers and algorithms in C++

Q: Default Constructor
A: Constructor with no parameters; used when object created without arguments

Q: int i vs int i
A: No compiler difference; syntactic perception may vary

Q: Head
A: First element of a list

Q: argc and argv
A: Command-line arguments for main(): argc = count, argv[] = values

Q: Inline Function
A: Function replaced with code body at compile-time to improve speed

Q: Array & Array Element
A: Sequence of contiguous memory values; element = individual value

Q: Pointer
A: Variable storing address of data

Q: Real Storage
A: Physical RAM memory

Q: Priority Queue
A: Queue storing items by priority (smallest/largest first)

Q: Stack vs Queue

Q: Method / Member Function
A: Routine associated with a class to manipulate its data

Q: Algorithm
A: Procedure for solving a task; may have multiple implementations

Q: Interface
A: Set of routines provided to manipulate class instances

Q: Abstract Data Type (ADT)
A: Data + operations, abstracted from implementation (e.g., Stack)

Q: Data Structure
A: Organizes data into identifiable bundles (e.g., struct, class)

Q: Member Function
A: Method associated with class, can access class data

Q: Reference
A: Access to a variable or element

Exit mobile version