RBSE Class 12th 2020 (Supp.)-SS-03-2020 Previous Year Papers
You opened the RBSE Class 12th 2020 (Supp.)-SS-03-2020 Previous Year Papers page — a focused place to read the real previous year question paper for that subject and year. RBSE Solution keeps exam-year sets together so you can practise the same cycle your seniors faced.
Previous year papers reward patience: read instructions, note mark distribution, then attempt questions before peeking at solutions elsewhere on the site. This URL always loads the same free previous year papers content for (Supp.)-SS-03-2020 (2020).
Use the details table to confirm class and year, then scroll to the paper images or PDF below. More subjects from 2020 are linked later on this page.
Paper details
Quick reference for this previous year papers page — confirm board, class, and year & subject before you study.
| Board | RBSE |
|---|---|
| Class | Class 12th |
| Exam year | 2020 |
| Subject | (Supp.)-SS-03-2020 |
| Resource type | Previous Year Papers |
| Category | RBSE Previous Year Question Papers |
| Website | RBSE Solution |
The table summarises this Previous Year Papers resource. Confirm RBSE, Class 12th, year 2020, and subject (Supp.)-SS-03-2020 before studying.
RBSE Solution organises previous year papers so each URL carries chapter-specific guidance — better for students and for search engines than one generic paragraph for the whole class.
How to practise with this question paper
Stage one: read the (Supp.)-SS-03-2020 question paper from 2020 without a timer and highlight command words — explain, prove, calculate, discuss. Stage two: attempt selected questions closed-book. Stage three: compare with solutions or teacher feedback.
Previous Year Papers work best when you log mistakes by topic, not only by question number. That log becomes your revision index before pre-boards.
RBSE Class 12th 2020 (Supp.)-SS-03-2020
Scroll through the Previous Year Papers pages for (Supp.)-SS-03-2020 (2020).
Rajasthan Board Class 12th (Supp.)-SS-03-2020 2020 solved Previous Year Question Papers
सूचना प्रौद्योगिकी (INFORMATION TECHNOLOGY AND PROGRAMMING-ID) (Optional)
उच्च माध्यमिक पूरक परीक्षा, 2020
समय : 3½ घण्टे पूर्णांक : 56
No. of Questions — 30 No. of Printed Pages — 8
SS-(3-Info. Tech. (Opt.) (Supp.)
परीक्षार्थियों के लिए सामान्य निर्देश :
GENERAL INSTRUCTIONS TO THE EXAMINEES :
- परीक्षार्थी सर्वप्रथम अपने प्रश्न-पत्र पर नामांक अनिवार्यतः लिखें।
Candidate must write first his/her Roll No. on the question paper compulsorily. - सभी प्रश्न करने अनिवार्य हैं।
All the questions are compulsory.
SS-03-Info.Tech. (Opt.) (Supp.) [ Turn over
निर्देश (Instructions)
(3) प्रत्येक प्रश्न का उत्तर दी गई उत्तर-पुस्तिका में ही लिखें।
Write the answer to each question in the given answer-book only.
(4) जिन प्रश्नों में आन्तरिक खण्ड हैं, उन सभी के उत्तर एक साथ ही लिखें।
For questions having more than one part, the answers to those parts are to be written together in continuity.
(5) प्रश्न-पत्र के हिन्दी व अंग्रेजी रूपांतर में किसी प्रकार की त्रुटि/अंतर/विरोधाभास होने पर हिन्दी भाषा के प्रश्न को ही सही मानें।
If there is any error / difference / contradiction in Hindi & English versions of the question paper, the question of Hindi version should be treated valid.
(6) खण्ड प्रश्न संख्या अंक प्रत्येक प्रश्न
| खण्ड (Section) | प्रश्न संख्या (Q. Nos.) | अंक प्रति प्रश्न (Marks per question) |
|---|---|---|
| अ (A) | 1-3 | 1 |
| ब (B) | 4-24 | 2 |
| स (C) | 25-27 | 3 |
| द (D) | 28-30 | 4 |
(7) प्रश्न संख्या 28, 29 व 30 में आन्तरिक विकल्प हैं।
Question Nos. 28, 29 and 30 have internal choices.
SS-03-Info.Tech. (Opt.) (Supp.)
खण्ड - अ
SECTION - A
-
लीनियर डाटा स्ट्रक्चर को परिभाषित कीजिए।
Define the Linear Data Structure.
उत्तर: लीनियर डाटा स्ट्रक्चर वह डाटा स्ट्रक्चर है जिसमें डेटा तत्वों को एक क्रम (sequence) में व्यवस्थित किया जाता है, जहाँ प्रत्येक तत्व का एक पूर्ववर्ती (predecessor) और एक अनुवर्ती (successor) होता है (पहले और अंतिम तत्व को छोड़कर)। उदाहरण: Array, Stack, Queue, Linked List.
Answer: A linear data structure is one where data elements are arranged in a sequence, where each element has a predecessor and a successor (except the first and last element). Examples: Array, Stack, Queue, Linked List.
-
बाइनरी खोज की समय जटिलता क्या है?
What is the time complexity of Binary search?
उत्तर: बाइनरी सर्च की समय जटिलता O(log n) है, जहाँ n तत्वों की संख्या है। यह केवल सॉर्ट किए गए डेटा पर लागू होती है।
Answer: The time complexity of Binary search is O(log n), where n is the number of elements. It is applicable only on sorted data.
-
स्टेबल सॉर्टिंग को परिभाषित कीजिए।
Define the stable sorting.
उत्तर: स्टेबल सॉर्टिंग वह सॉर्टिंग एल्गोरिथ्म है जो समान कुंजी (keys) वाले तत्वों के सापेक्ष क्रम (relative order) को बनाए रखता है। उदाहरण: Merge Sort, Insertion Sort.
Answer: Stable sorting is a sorting algorithm that maintains the relative order of elements with equal keys. Examples: Merge Sort, Insertion Sort.
-
एब्सट्रेक्ट डेटा स्ट्रक्चर का उदाहरण दीजिए।
Give the example of Abstract data structure.
उत्तर: एब्सट्रेक्ट डेटा स्ट्रक्चर (ADT) का उदाहरण: Stack, Queue, List, Tree, Graph. ये डेटा के संगठन और उस पर किए जाने वाले ऑपरेशन को परिभाषित करते हैं, लेकिन कार्यान्वयन (implementation) को छिपाते हैं।
Answer: Examples of Abstract Data Structure (ADT): Stack, Queue, List, Tree, Graph. These define the organization of data and operations on it, but hide the implementation.
-
डायनामिक डेटा स्ट्रक्चर का उदाहरण दीजिए।
Give the example of Dynamic data structure.
उत्तर: डायनामिक डेटा स्ट्रक्चर का उदाहरण: Linked List, Stack (using linked list), Queue (using linked list), Tree. इनका आकार रन टाइम पर बदल सकता है।
Answer: Examples of Dynamic data structure: Linked List, Stack (using linked list), Queue (using linked list), Tree. Their size can change at runtime.
-
Linux OS में C++ प्रोग्राम को कम्पाइल करने की कमांड लिखिए।
Write the command to compile the C++ program in Linux OS.
उत्तर: Linux OS में C++ प्रोग्राम को कम्पाइल करने की कमांड है:
g++ filename.cpp -o outputfile(जहाँ filename.cpp स्रोत फ़ाइल है और outputfile आउटपुट फ़ाइल का नाम है)।Answer: The command to compile a C++ program in Linux OS is:
g++ filename.cpp -o outputfile(where filename.cpp is the source file and outputfile is the name of the output file). -
ऑपरेटर प्रिसीडेंस को परिभाषित कीजिए।
Define the Operator precedence.
उत्तर: ऑपरेटर प्रिसीडेंस (Operator Precedence) वह नियम है जो यह निर्धारित करता है कि किसी एक्सप्रेशन में किस ऑपरेटर को पहले evaluate किया जाएगा। उच्च precedence वाले ऑपरेटर को पहले evaluate किया जाता है। उदाहरण: गुणा (*) का precedence जोड़ (+) से अधिक होता है।
Answer: Operator precedence is the rule that determines which operator will be evaluated first in an expression. Operators with higher precedence are evaluated first. Example: Multiplication (*) has higher precedence than addition (+).
-
फंक्शन ओवरलोडिंग क्या होती है?
What is the function overloading?
उत्तर: फंक्शन ओवरलोडिंग (Function Overloading) एक प्रोग्रामिंग तकनीक है जिसमें एक ही नाम के कई फंक्शन बनाए जाते हैं, लेकिन उनके पैरामीटर (प्रकार, संख्या या क्रम) अलग-अलग होते हैं। यह कंपाइल टाइम पॉलीमॉर्फिज्म का एक उदाहरण है।
Answer: Function overloading is a programming technique where multiple functions with the same name are created, but their parameters (type, number, or order) are different. It is an example of compile-time polymorphism.
SS-03-Info.Tech. (Opt.) (Supp.) [ Turn over
स्टैटिक मेम्बर फंक्शन को परिभाषित कीजिए |
Define the Static Member function.
Static Member Function: यह एक ऐसा सदस्य फंक्शन है जो किसी क्लास के सभी ऑब्जेक्ट्स के लिए साझा होता है। इसे static कीवर्ड से घोषित किया जाता है और यह केवल स्टैटिक डेटा मेम्बर्स तक ही पहुँच सकता है। इसे क्लास के नाम से सीधे कॉल किया जा सकता है, बिना ऑब्जेक्ट बनाए।
कॉपी कंस्ट्रक्टर क्या होता है ?
What is the copy constructor ?
Copy Constructor: यह एक विशेष प्रकार का कंस्ट्रक्टर है जो किसी ऑब्जेक्ट को उसी क्लास के किसी दूसरे ऑब्जेक्ट से कॉपी करके बनाता है। इसका उपयोग ऑब्जेक्ट को पास करते समय या रिटर्न करते समय डीप कॉपी बनाने के लिए किया जाता है। इसका सिंटैक्स: ClassName(const ClassName &obj).
ऐसे ऑपरेटर का नाम लिखिए जिसको ओवरलोड नहीं किया जा सकता है |
Give the name of operator that cannot be overloaded.
उत्तर: :: (स्कोप रिज़ॉल्यूशन ऑपरेटर), . (डॉट ऑपरेटर), .* (पॉइंटर टू मेंबर ऑपरेटर), ?: (टर्नरी ऑपरेटर), sizeof, और typeid ऑपरेटरों को ओवरलोड नहीं किया जा सकता।
बहु मान एट्रीब्यूट को परिभाषित कीजिए |
Define the Multi valued attribute.
Multi-valued Attribute: यह एक ऐसा एट्रीब्यूट है जिसमें एक ही एंटिटी के लिए एक से अधिक मान हो सकते हैं। उदाहरण के लिए, किसी व्यक्ति के फोन नंबर (एक से अधिक नंबर) या ईमेल पते। इसे डेटाबेस में अलग टेबल या कॉम्प्लेक्स डेटा टाइप के रूप में दर्शाया जाता है।
डाटा बेस स्कीमा क्या होती है ?
What is the Data Base Schema ?
Database Schema: यह डेटाबेस की संरचना का एक लॉजिकल डिज़ाइन है जो टेबल्स, उनके कॉलम, डेटा टाइप्स, रिलेशनशिप्स और कंस्ट्रेंट्स को परिभाषित करता है। यह डेटाबेस के ब्लूप्रिंट की तरह होता है और इसे तीन स्तरों में बांटा जाता है: फिजिकल, लॉजिकल और व्यू स्कीमा।
खण्ड-ब
SECTION - B
समय जटिलता से आप क्या समझते हैं ?
What do you understand by Time Complexity ?
Time Complexity: यह किसी एल्गोरिदम द्वारा लिए गए समय की मात्रा को मापता है, जो इनपुट साइज (n) के फंक्शन के रूप में व्यक्त किया जाता है। इसे बिग-ओ नोटेशन (जैसे O(n), O(log n), O(n²)) में दर्शाया जाता है और यह एल्गोरिदम की दक्षता का मूल्यांकन करने में मदद करता है।
रिकर्शन फंक्शन के लिए शर्तें लिखिए |
Write the conditions for recursion functions.
Recursion Function Conditions:
- Base Case: एक ऐसी शर्त जो रिकर्शन को समाप्त करती है (जैसे n == 0 या n == 1)।
- Recursive Case: फंक्शन स्वयं को छोटे इनपुट के साथ कॉल करता है, जो बेस केस की ओर बढ़ता है।
- Progress: प्रत्येक रिकर्सिव कॉल में इनपुट साइज कम होना चाहिए ताकि अनंत लूप से बचा जा सके।
इन-प्लेस सॉर्टिंग क्या होती है ?
What is the In-place sorting ?
In-place Sorting: यह एक सॉर्टिंग एल्गोरिदम है जो डेटा को सॉर्ट करने के लिए अतिरिक्त मेमोरी का उपयोग नहीं करता (या केवल O(1) अतिरिक्त स्पेस लेता है)। यह मूल ऐरे या लिस्ट में ही एलिमेंट्स को स्वैप करके सॉर्ट करता है। उदाहरण: क्विक सॉर्ट, हीप सॉर्ट, इंसर्शन सॉर्ट।
SS-03-Info.Tech. (Opt.) (Supp.)
7. GRR और यूनियन में अन्तर स्पष्ट कीजिए | 2
Clear the difference between the Structure and Union.
Structure (स्ट्रक्चर): इसमें सभी सदस्यों के लिए अलग-अलग मेमोरी स्थान आवंटित होता है। सभी सदस्यों को एक साथ एक्सेस किया जा सकता है। कुल मेमोरी सभी सदस्यों के आकार के योग के बराबर होती है।
Union (यूनियन): इसमें सभी सदस्य एक ही मेमोरी स्थान साझा करते हैं। एक समय में केवल एक सदस्य को एक्सेस किया जा सकता है। कुल मेमोरी सबसे बड़े सदस्य के आकार के बराबर होती है।
8. स्कोप रिजोलुशन ऑपरेटर का क्या उपयोग है ? 2
What is the use of Scope resolution operator ?
स्कोप रिजोलुशन ऑपरेटर (::) का उपयोग निम्नलिखित कार्यों के लिए किया जाता है:
- किसी क्लास के बाहर उसके सदस्य फंक्शन को परिभाषित करने के लिए।
- ग्लोबल वेरिएबल को एक्सेस करने के लिए जब लोकल वेरिएबल का नाम समान हो।
- स्टैटिक वेरिएबल या फंक्शन को एक्सेस करने के लिए।
- नेमस्पेस के सदस्यों को एक्सेस करने के लिए।
9. फ्रेंड फंक्शन का क्या उपयोग है ? 2
What is the use of Friend function ?
फ्रेंड फंक्शन का उपयोग किसी क्लास के प्राइवेट और प्रोटेक्टेड डेटा सदस्यों को बाहर से एक्सेस करने के लिए किया जाता है। यह क्लास का सदस्य नहीं होता, लेकिन इसे क्लास के अंदर friend कीवर्ड से घोषित किया जाता है। इसका उपयोग ऑपरेटर ओवरलोडिंग और दो क्लासों के बीच डेटा साझा करने में किया जाता है।
20. SQL में SELECT स्टेटमेंट से आप क्या समझते हैं ? 2
What do you understand by SELECT statement in SQL ?
SELECT स्टेटमेंट SQL में डेटा को डेटाबेस से प्राप्त करने (query) के लिए उपयोग किया जाता है। यह एक या अधिक टेबलों से डेटा को चुनकर प्रदर्शित करता है। इसका सामान्य सिंटैक्स है:
SELECT column1, column2 FROM table_name WHERE condition;
यह डेटा को फ़िल्टर, सॉर्ट और ग्रुप करने की सुविधा भी प्रदान करता है।
21. MySQL में नया यूजर बनाने की कमांड लिखिए | 2
Write the command to create new user in MySQL.
MySQL में नया यूजर बनाने की कमांड:
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
उदाहरण:
CREATE USER 'raj'@'localhost' IDENTIFIED BY 'raj123';
22. कॉल-बाय वैल्यू और कॉल-बाय रेफरेंस में क्या अन्तर है ? 2
What is the difference between call-by-value and call-by-reference ?
Call-by-Value (कॉल-बाय वैल्यू): इसमें फंक्शन को आर्गुमेंट की कॉपी भेजी जाती है। फंक्शन में किए गए बदलाव मूल वेरिएबल को प्रभावित नहीं करते।
Call-by-Reference (कॉल-बाय रेफरेंस): इसमें फंक्शन को आर्गुमेंट का एड्रेस (रेफरेंस) भेजा जाता है। फंक्शन में किए गए बदलाव मूल वेरिएबल को प्रभावित करते हैं।
23. PL/SQL में ट्रिगर्स को समझाइए | 2
Explain the Triggers in PL/SQL.
ट्रिगर PL/SQL में एक स्टोर्ड प्रोग्राम है जो किसी टेबल पर INSERT, UPDATE या DELETE ऑपरेशन होने पर स्वचालित रूप से निष्पादित होता है। ट्रिगर के प्रकार:
- BEFORE ट्रिगर: ऑपरेशन से पहले निष्पादित होता है।
- AFTER ट्रिगर: ऑपरेशन के बाद निष्पादित होता है।
- INSTEAD OF ट्रिगर: व्यू पर ऑपरेशन के लिए उपयोग होता है।
ट्रिगर का उपयोग डेटा इंटीग्रिटी बनाए रखने, ऑडिटिंग और व्यावसायिक नियमों को लागू करने में किया जाता है।
24. PL/SQL में तीन प्रकार के एक्सेप्शन के नाम लिखिए | 2
Write the name of three types of exceptions in PL/SQL.
PL/SQL में तीन प्रकार के एक्सेप्शन:
- प्रीडिफाइंड एक्सेप्शन (Predefined Exceptions): जैसे NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE आदि।
- यूजर-डिफाइंड एक्सेप्शन (User-defined Exceptions): प्रोग्रामर द्वारा परिभाषित किए जाते हैं।
- अनहैंडल्ड एक्सेप्शन (Unhandled Exceptions): जिन्हें कैच नहीं किया गया हो, वे प्रोग्राम को समाप्त कर देते हैं।
खण्ड-स (Section – C)
25. ‘C’ भाषा में निम्न संख्याओं को त्वरित सॉर्टिंग विधि से सॉर्ट करने का प्रोग्राम लिखिए :
4, 6, 3, 2, 1, 9, 7
प्रोग्राम (Quick Sort in C):
#include <stdio.h>
void swap(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
int partition(int arr[], int low, int high) {
int pivot = arr[high];
int i = (low - 1);
for (int j = low; j <= high - 1; j++) {
if (arr[j] < pivot) {
i++;
swap(&arr[i], &arr[j]);
}
}
swap(&arr[i + 1], &arr[high]);
return (i + 1);
}
void quickSort(int arr[], int low, int high) {
if (low < high) {
int pi = partition(arr, low, high);
quickSort(arr, low, pi - 1);
quickSort(arr, pi + 1, high);
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size; i++)
printf("%d ", arr[i]);
printf("\n");
}
int main() {
int arr[] = {4, 6, 3, 2, 1, 9, 7};
int n = sizeof(arr) / sizeof(arr[0]);
printf("Original array: ");
printArray(arr, n);
quickSort(arr, 0, n - 1);
printf("Sorted array: ");
printArray(arr, n);
return 0;
}
आउटपुट: 1 2 3 4 6 7 9
26. Stack के उपयोग को विस्तार से बताइए।
Stack (स्टैक) के उपयोग: Stack एक LIFO (Last In First Out) डेटा संरचना है। इसके प्रमुख उपयोग निम्नलिखित हैं:
- Function Calls (फंक्शन कॉल): प्रोग्राम में फंक्शन कॉल को मैनेज करने के लिए stack का उपयोग होता है। जब कोई फंक्शन कॉल किया जाता है, तो उसका return address और local variables stack पर push होते हैं, और फंक्शन समाप्त होने पर pop होते हैं।
- Expression Evaluation (एक्सप्रेशन मूल्यांकन): इनफिक्स, पोस्टफिक्स और प्रीफिक्स एक्सप्रेशन को evaluate करने में stack का उपयोग होता है।
- Undo/Redo Operations: टेक्स्ट एडिटर या सॉफ्टवेयर में undo/redo कार्यों के लिए stack का उपयोग किया जाता है।
- Backtracking (बैकट्रैकिंग): जैसे Maze solving, N-Queens problem आदि में stack का उपयोग होता है।
- Syntax Parsing: कंपाइलर में syntax checking और parsing के लिए stack का उपयोग होता है।
- Browser History: वेब ब्राउज़र में पिछले पेज पर जाने के लिए stack का उपयोग होता है।
27. लिंक लिस्ट में आप किसी नोड को कैसे Delete करते हैं? समझाइये।
लिंक लिस्ट में नोड डिलीट करना: लिंक लिस्ट में नोड को डिलीट करने के तीन मुख्य केस होते हैं:
- पहले नोड को डिलीट करना: head को head->next पर सेट करें और पुराने head को free करें।
- बीच के नोड को डिलीट करना: डिलीट होने वाले नोड के पिछले नोड के next pointer को डिलीट होने वाले नोड के next पर सेट करें, फिर नोड को free करें।
- अंतिम नोड को डिलीट करना: अंतिम नोड के पिछले नोड के next को NULL सेट करें और अंतिम नोड को free करें।
उदाहरण (C code):
void deleteNode(struct Node** head_ref, int key) {
struct Node *temp = *head_ref, *prev = NULL;
// यदि पहला नोड ही डिलीट करना है
if (temp != NULL && temp->data == key) {
*head_ref = temp->next;
free(temp);
return;
}
// बीच या अंत का नोड ढूंढें
while (temp != NULL && temp->data != key) {
prev = temp;
temp = temp->next;
}
if (temp == NULL) return; // key नहीं मिली
prev->next = temp->next;
free(temp);
}
28. पैरामीटराइज्ड कंस्ट्रक्टर को उदाहरण से समझाइये।
पैरामीटराइज्ड कंस्ट्रक्टर: वह कंस्ट्रक्टर जो पैरामीटर (arguments) लेता है, पैरामीटराइज्ड कंस्ट्रक्टर कहलाता है। इसका उपयोग ऑब्जेक्ट बनाते समय अलग-अलग initial values देने के लिए किया जाता है।
उदाहरण (C++):
#include <iostream>
using namespace std;
class Student {
int rollNo;
string name;
public:
// पैरामीटराइज्ड कंस्ट्रक्टर
Student(int r, string n) {
rollNo = r;
name = n;
}
void display() {
cout << "Roll No: " << rollNo << ", Name: " << name << endl;
}
};
int main() {
Student s1(101, "Rahul");
Student s2(102, "Priya");
s1.display();
s2.display();
return 0;
}
आउटपुट:
Roll No: 101, Name: Rahul
Roll No: 102, Name: Priya
अथवा (OR)
28. बाइनरी प्लस (+) ऑपरेटर को ओवरलोड करते हुए निम्नलिखित दो मैट्रिक्स का योग करने का प्रोग्राम C++ में लिखिए :
| 1 2 3 | | 7 8 9 |
| 4 5 6 | + | 1 2 3 |
प्रोग्राम (C++ में + ऑपरेटर ओवरलोडिंग):
#include <iostream>
using namespace std;
class Matrix {
int arr[2][3];
public:
void input() {
cout << "Enter 6 elements (2x3 matrix): ";
for(int i=0; i<2; i++)
for(int j=0; j<3; j++)
cin >> arr[i][j];
}
void display() {
for(int i=0; i<2; i++) {
for(int j=0; j<3; j++)
cout << arr[i][j] << " ";
cout << endl;
}
}
// + ऑपरेटर ओवरलोडिंग
Matrix operator+(Matrix m) {
Matrix temp;
for(int i=0; i<2; i++)
for(int j=0; j<3; j++)
temp.arr[i][j] = arr[i][j] + m.arr[i][j];
return temp;
}
};
int main() {
Matrix m1, m2, m3;
cout << "Matrix 1:" << endl;
m1.input();
cout << "Matrix 2:" << endl;
m2.input();
m3 = m1 + m2;
cout << "Sum of matrices:" << endl;
m3.display();
return 0;
}
आउटपुट (दिए गए मैट्रिक्स के लिए):
8 10 12
5 7 9
29.
एक स्कूल प्रबंधन प्रणाली के लिए E-R आरेख बनाइये | इस E-R आरेख में प्रयुक्त प्रत्येक प्रतीक की उपयोगिता समझाइए |
अथवा
द्वितीय नॉर्मल फॉर्म को उदाहरण सहित समझाइये |
Draw an E-R diagram for a School Management System. Explain the utility of each symbol used in this E-R diagram.
OR
Explain the second normal form with the help of example.
E-R Diagram for School Management System
Entities and Symbols:
- Rectangle (Entity): Represents real-world objects like Student, Teacher, Class, Subject.
- Ellipse (Attribute): Describes properties of entities, e.g., Student_Name, Teacher_ID.
- Diamond (Relationship): Shows association between entities, e.g., Enrolls (Student-Class), Teaches (Teacher-Subject).
- Line (Connector): Links entities to relationships and attributes.
- Double Ellipse (Multivalued Attribute): Holds multiple values, e.g., Phone_Numbers of a student.
- Underlined Attribute (Primary Key): Uniquely identifies each entity instance, e.g., Student_ID.
Example Diagram Structure:
[Student] ----< Enrolls >---- [Class]
| |
(Student_ID) (Class_ID)
(Name) (Section)
(Phone_Numbers)
Utility of Each Symbol:
- Rectangle: Defines core data objects.
- Ellipse: Provides detailed information about entities.
- Diamond: Clarifies how entities interact.
- Lines: Ensure structural clarity.
- Double Ellipse: Handles attributes with multiple instances.
- Underline: Ensures uniqueness and efficient data retrieval.
OR
Second Normal Form (2NF) with Example
Definition: A table is in 2NF if it is in 1NF and every non-key attribute is fully functionally dependent on the primary key (no partial dependency).
Example:
Unnormalized Table (Student_Course):
| Student_ID | Course_ID | Student_Name | Course_Name | Grade |
|---|---|---|---|---|
| 101 | C01 | Ravi | Maths | A |
| 101 | C02 | Ravi | Science | B |
Problem: Primary key is (Student_ID, Course_ID). Student_Name depends only on Student_ID (partial dependency).
Convert to 2NF:
Table 1: Student
| Student_ID (PK) | Student_Name |
|---|---|
| 101 | Ravi |
Table 2: Course
| Course_ID (PK) | Course_Name |
|---|---|
| C01 | Maths |
| C02 | Science |
Table 3: Enrollment
| Student_ID (FK) | Course_ID (FK) | Grade |
|---|---|---|
| 101 | C01 | A |
| 101 | C02 | B |
Result: All non-key attributes now fully depend on the primary key, satisfying 2NF.
30.
मल्टीपल इनहेरिटेंस को उदाहरण द्वारा समझाइये |
अथवा
सी प्रोग्रामिंग भाषा में प्रयुक्त मेमोरी एलोकेशन और प्रबन्धन के फंक्शन को समझाइये |
Explain multiple inheritance with the help of example.
OR
Explain the function used for memory allocation and management in ‘C’ programming language.
Multiple Inheritance with Example
Definition: Multiple inheritance is a feature in object-oriented programming where a class can inherit properties and methods from more than one parent class.
Example (C++):
class Student {
public:
void study() { cout << "Studying"; }
};
class Athlete {
public:
void play() { cout << "Playing"; }
};
class ScholarAthlete : public Student, public Athlete {
public:
void display() {
study();
play();
}
};
int main() {
ScholarAthlete sa;
sa.display(); // Output: StudyingPlaying
return 0;
}
Explanation: The class ScholarAthlete inherits from both Student and Athlete, gaining access to both study() and play() methods. This allows combining behaviors from multiple sources.
Note: Multiple inheritance can lead to ambiguity (diamond problem) if not handled carefully, often resolved using virtual inheritance in C++.
OR
Memory Allocation and Management Functions in C
Dynamic Memory Allocation Functions:
- malloc(size_t size): Allocates a block of memory of given size (in bytes) and returns a void pointer to it. Memory is uninitialized.
- calloc(size_t num, size_t size): Allocates memory for an array of num elements, each of size bytes, and initializes all bits to zero.
- realloc(void *ptr, size_t new_size): Resizes a previously allocated memory block pointed by ptr to new_size. May move the block to a new location.
- free(void *ptr): Deallocates the memory previously allocated by malloc, calloc, or realloc, making it available for future allocations.
Example:
#include <stdlib.h>
int *arr = (int*) malloc(5 * sizeof(int)); // allocate array of 5 ints
if (arr != NULL) {
arr[0] = 10;
free(arr); // free memory
}
Key Points:
- Always check if allocation returns NULL (failure).
- Use
free()to avoid memory leaks. - Include
<stdlib.h>for these functions.