computer_science_important_topics
computer_science_important_topics
struct Student {
int rollNo;
char name[50];
float marks;
};
Types of Polymorphism:
1. Compile-Time Polymorphism (Method Overloading):
- Multiple functions with the same name but different parameter lists.
Example:
class Calculator {
public:
int add(int a, int b) { return a + b; }
float add(float a, float b) { return a + b; }
};
Example:
class Animal {
public:
virtual void sound() { cout << "Some sound"; }
};
3. Linked Lists
Example:
struct Node {
int data;
Node* next;
};
4. HTML Basics
<table border="1">
<tr>
<th>Roll No</th>
<th>Name</th>
<th>Marks</th>
</tr>
<tr>
<td>1</td>
<td>John</td>
<td>85</td>
</tr>
<tr>
<td>2</td>
<td>Jane</td>
<td>90</td>
</tr>
</table>
5. JavaScript Functions
6. SQL Commands
- Delete Table:
DROP TABLE Student;
- Foreign Key: A field that creates a relationship between two tables. It refers to
the primary key in another table.
Example: In an Order table, CustomerID could be a foreign key referring to
CustomerID in a Customer table.
Question: Write an algorithm for the insertion operation in a QUEUE data structure.
Answer:
The Queue follows FIFO (First In First Out) order. For insertion (enqueue), you add
an element to the rear of the queue.
Example CSS:
@media (max-width: 600px) {
body {
background-color: lightblue;
}
}