RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers

-II-SS-03-2018 from the 2018 exam year is part of the Class 12th previous year papers archive on RBSE Solution. Many learners start here after finishing the textbook to see how questions were actually framed on the Rajasthan Board of Secondary Education (RBSE) paper.

Treat this question paper as a mock under gentle timing first, then as a marking exercise the second time. The introduction on this page is written only for this subject-and-year pair, not copied from other pages.

Bookmark the link if you coach juniors — the layout stays stable for search engines and classroom sharing.

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 2018
Subject -II-SS-03-2018
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 2018, and subject -II-SS-03-2018 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 -II-SS-03-2018 question paper from 2018 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 2018 -II-SS-03-2018

Scroll through the Previous Year Papers pages for -II-SS-03-2018 (2018).

RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers 0
https://rbsesolution.com
RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers 1
https://rbsesolution.com
RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers 2
https://rbsesolution.com
RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers 3
https://rbsesolution.com
RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers 4
https://rbsesolution.com
RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers 5
https://rbsesolution.com
RBSE Class 12th 2018 -II-SS-03-2018 Previous Year Papers 6
https://rbsesolution.com

Rajasthan Board Class 12th -II-SS-03-2018 2018 solved Previous Year Question Papers

उच्च माध्यमिक परीक्षा, 2018
SENIOR SECONDARY EXAMINATION, 2018

सूचना प्रौद्योगिकी और प्रोग्रामिंग - II
INFORMATION TECHNOLOGY AND PROGRAMMING - II
ऐच्छिक (Optional)

समय : 3¼ घण्टे    पूर्णांक : 56


परीक्षार्थियों के लिए सामान्य निर्देश :
GENERAL INSTRUCTIONS TO THE EXAMINEES :

  1. परीक्षार्थी सर्वप्रथम अपने प्रश्न पत्र पर नामांक अनिवार्यत: लिखें।
    Candidate must write first his / her Roll No. on the question paper compulsorily.
  2. सभी प्रश्न करने अनिवार्य हैं।
    All the questions are compulsory.
  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.

No. of Questions — 30
No. of Printed Pages — 07

SS—03-Info.Tech.(Opt.)

SS—03-Info. Tech. (050) [ 2043

खण्ड - अ / SECTION - A

1) नॉन लिनियर डाटा स्ट्रक्चर को परिभाषित कीजिए। [1]

Define Non linear data structure.

उत्तर / Answer: नॉन लिनियर डाटा स्ट्रक्चर वह डाटा स्ट्रक्चर है जिसमें डाटा तत्व एक से अधिक स्तरों (levels) में व्यवस्थित होते हैं और प्रत्येक तत्व एक से अधिक तत्वों से जुड़ा हो सकता है। उदाहरण: ट्री (Tree) और ग्राफ (Graph)।

A non-linear data structure is one in which data elements are arranged in multiple levels and each element can be connected to more than one element. Examples: Tree and Graph.

2) Malloc फंक्शन का सिन्टेक्स लिखिए। [1]

Write Syntax of Malloc Memory function?

उत्तर / Answer: void *malloc(size_t size);

यह फंक्शन stdlib.h हेडर फाइल में परिभाषित होता है और मेमोरी के बाइट्स की निर्दिष्ट संख्या आवंटित करता है।

This function is defined in the stdlib.h header file and allocates the specified number of bytes of memory.

3) त्वरित सार्टिंग की समय जटिलता क्या होती है? [1]

What is the time complexity of Quick Sort?

उत्तर / Answer:

  • सर्वश्रेष्ठ स्थिति (Best case): O(n log n)
  • औसत स्थिति (Average case): O(n log n)
  • सबसे खराब स्थिति (Worst case): O(n²)

Best case: O(n log n), Average case: O(n log n), Worst case: O(n²)

4) aq को परिभाषित किजिए।
Define queue.

Queue (aq) एक रैखिक डेटा संरचना है जो FIFO (First In First Out) सिद्धांत पर कार्य करती है। इसमें नया तत्व पीछे (rear) से जोड़ा जाता है और तत्व सामने (front) से हटाया जाता है।

A queue is a linear data structure that works on the FIFO (First In First Out) principle. New elements are added at the rear and removed from the front.

5) लिंक्ड लिस्ट के कोई दो नुकसान बताईए।
Give any two disadvantages of Linked list.

  1. अतिरिक्त मेमोरी खपत: प्रत्येक नोड में डेटा के साथ पॉइंटर (अगले नोड का पता) भी संग्रहीत होता है, जिससे मेमोरी का अधिक उपयोग होता है।
  2. डायरेक्ट एक्सेस नहीं: किसी विशेष स्थान पर तत्व तक पहुँचने के लिए शुरू से अंत तक ट्रैवर्स करना पड़ता है, जिससे सर्च ऑपरेशन धीमा हो जाता है।

1. Extra memory consumption: Each node stores a pointer along with data, leading to higher memory usage.
2. No direct access: To access an element at a specific position, traversal from the beginning is required, making search operations slower.

6) लिंक्ड लिस्ट के विभिन्न प्रकार बताईए।
Give different types of Linked list.

  1. सिंगली लिंक्ड लिस्ट (Singly Linked List): प्रत्येक नोड में केवल अगले नोड का पॉइंटर होता है।
  2. डबली लिंक्ड लिस्ट (Doubly Linked List): प्रत्येक नोड में अगले और पिछले दोनों नोड्स के पॉइंटर होते हैं।
  3. सर्कुलर लिंक्ड लिस्ट (Circular Linked List): अंतिम नोड पहले नोड को पॉइंट करता है, जिससे एक चक्र बनता है।
  4. सर्कुलर डबली लिंक्ड लिस्ट (Circular Doubly Linked List): डबली लिंक्ड लिस्ट और सर्कुलर लिंक्ड लिस्ट का संयोजन।

1. Singly Linked List: Each node has a pointer to the next node only.
2. Doubly Linked List: Each node has pointers to both next and previous nodes.
3. Circular Linked List: The last node points to the first node, forming a cycle.
4. Circular Doubly Linked List: Combination of doubly and circular linked lists.

7) DDL को परिभाषित किजिए।
Define DDL.

DDL (Data Definition Language) SQL का एक उपसमूह है जिसका उपयोग डेटाबेस की संरचना को परिभाषित करने, बदलने या हटाने के लिए किया जाता है। इसमें CREATE, ALTER, DROP, TRUNCATE जैसे कमांड शामिल हैं।

DDL (Data Definition Language) is a subset of SQL used to define, modify, or delete the structure of a database. It includes commands like CREATE, ALTER, DROP, and TRUNCATE.

8) कैन्डीडेट की क्या होती है?
What is Candidate Key?

कैन्डीडेट की (Candidate Key) एक ऐसा एट्रीब्यूट या एट्रीब्यूट्स का समूह है जो किसी तालिका में प्रत्येक पंक्ति को विशिष्ट रूप से पहचान सकता है। एक तालिका में एक से अधिक कैन्डीडेट की हो सकती हैं, जिनमें से एक को प्राथमिक की (Primary Key) के रूप में चुना जाता है।

A Candidate Key is an attribute or set of attributes that can uniquely identify each row in a table. A table can have multiple candidate keys, one of which is selected as the Primary Key.

9) dbms_output.put_line नामक निर्देश का उपयोग बताईए।
What is the use of dbms_output.put_line?

dbms_output.put_line Oracle PL/SQL में एक प्रक्रिया है जिसका उपयोग डीबगिंग और आउटपुट प्रदर्शित करने के लिए किया जाता है। यह टेक्स्ट या वेरिएबल के मान को स्क्रीन पर प्रिंट करता है, जिससे प्रोग्राम के निष्पादन के दौरान मध्यवर्ती परिणाम देखे जा सकते हैं।

dbms_output.put_line is a procedure in Oracle PL/SQL used for debugging and displaying output. It prints text or variable values to the screen, allowing intermediate results to be viewed during program execution.

10) SQL में NOW() फंक्शन का उपयोग क्या है?
What is the use of NOW() function in SQL?

NOW() फंक्शन SQL में वर्तमान दिनांक और समय (current date and time) को लौटाता है। इसका उपयोग टाइमस्टैम्प रिकॉर्ड करने, डिफ़ॉल्ट मान सेट करने, या समय-आधारित क्वेरीज़ में किया जाता है।

The NOW() function in SQL returns the current date and time. It is used to record timestamps, set default values, or in time-based queries.

प्रश्न 11: ऑपरेटर एसोसिएटिविटी क्या है? / What is operator associativity?

हिंदी: ऑपरेटर एसोसिएटिविटी यह निर्धारित करती है कि जब एक ही प्राथमिकता वाले दो या अधिक ऑपरेटर एक अभिव्यक्ति में हों, तो उनका मूल्यांकन किस क्रम (बाएं से दाएं या दाएं से बाएं) में होगा। उदाहरण के लिए, + और - की एसोसिएटिविटी बाएं से दाएं होती है, जबकि = (असाइनमेंट) की एसोसिएटिविटी दाएं से बाएं होती है।

English: Operator associativity defines the order in which operators of the same precedence are evaluated in an expression, either left-to-right or right-to-left. For example, + and - have left-to-right associativity, while = (assignment) has right-to-left associativity.

प्रश्न 12: C++ में new ऑपरेटर का क्या उपयोग है? / What is the use of new operator in C++?

हिंदी: C++ में new ऑपरेटर का उपयोग डायनामिक मेमोरी आवंटन (dynamic memory allocation) के लिए किया जाता है। यह हीप (heap) मेमोरी से किसी वेरिएबल या ऑब्जेक्ट के लिए मेमोरी आवंटित करता है और उसका पॉइंटर लौटाता है। उदाहरण: int *p = new int; या MyClass *obj = new MyClass();

English: In C++, the new operator is used for dynamic memory allocation. It allocates memory from the heap for a variable or object and returns a pointer to it. Example: int *p = new int; or MyClass *obj = new MyClass();

प्रश्न 13: C++ में एक्सेस मोडिफायर क्या होता है? / What is access Modifier in C++?

हिंदी: एक्सेस मोडिफायर (Access Modifier) C++ में क्लास के सदस्यों (मेम्बर्स) की पहुंच (accessibility) को नियंत्रित करते हैं। तीन मुख्य एक्सेस मोडिफायर हैं: public (सभी के लिए सुलभ), private (केवल क्लास के अंदर सुलभ), और protected (क्लास और उसके डेराइव्ड क्लास में सुलभ)।

English: Access modifiers in C++ control the accessibility of class members. The three main access modifiers are: public (accessible from anywhere), private (accessible only within the class), and protected (accessible within the class and its derived classes).

खण्ड - ब / SECTION - B

प्रश्न 14: E-R आरेख में वन टु मैनी सम्बन्ध का क्या अर्थ है? / What is the meaning of One to Many relationship in E-R diagram?

हिंदी: E-R आरेख में वन टु मैनी (1:N) सम्बन्ध का अर्थ है कि एक इकाई (entity) के एक उदाहरण (instance) का दूसरी इकाई के कई उदाहरणों से सम्बन्ध हो सकता है। उदाहरण: एक विभाग (Department) में कई कर्मचारी (Employee) कार्य कर सकते हैं, लेकिन एक कर्मचारी केवल एक विभाग में होता है।

English: In an E-R diagram, a One to Many (1:N) relationship means that one instance of an entity can be associated with many instances of another entity. Example: One Department can have many Employees, but one Employee belongs to only one Department.

प्रश्न 15: साधारण और समग्र एट्रीब्युट में अन्तर बताईए। / Differentiate between Simple and Composite attribute.

साधारण एट्रीब्युट (Simple Attribute) समग्र एट्रीब्युट (Composite Attribute)
इसे आगे छोटे भागों में विभाजित नहीं किया जा सकता। इसे आगे छोटे उप-एट्रीब्युट में विभाजित किया जा सकता है।
उदाहरण: कर्मचारी का वेतन (Salary), आयु (Age)। उदाहरण: पता (Address) को स्ट्रीट, शहर, पिनकोड में विभाजित किया जा सकता है।
एकल मान रखता है। कई संबंधित मानों का समूह होता है।

प्रश्न 16: डाटाबेस डिजाइन के चरणों को लिखिए। / Write the steps to design a database.

  1. आवश्यकता विश्लेषण (Requirement Analysis): उपयोगकर्ताओं की आवश्यकताओं और डेटा के उपयोग को समझना।
  2. संकल्पनात्मक डिजाइन (Conceptual Design): E-R मॉडल बनाना, जिसमें इकाइयाँ, एट्रीब्युट और सम्बन्ध शामिल हों।
  3. तार्किक डिजाइन (Logical Design): E-R मॉडल को रिलेशनल मॉडल (टेबल्स) में बदलना और नॉर्मलाइजेशन करना।
  4. भौतिक डिजाइन (Physical Design): डेटाबेस को लागू करना, इंडेक्स बनाना, और स्टोरेज पैरामीटर सेट करना।
  5. कार्यान्वयन और परीक्षण (Implementation and Testing): डेटाबेस बनाना, डेटा डालना, और क्वेरीज़ का परीक्षण करना।

प्रश्न 17: PL/SQL में SET Serveroutput ON का क्या उपयोग है? / What is the use of SET Serveroutput ON in PL/SQL?

हिंदी: PL/SQL में SET Serveroutput ON का उपयोग सर्वर से आउटपुट को क्लाइंट (जैसे SQL*Plus) पर प्रदर्शित करने के लिए किया जाता है। इसके बिना, DBMS_OUTPUT.PUT_LINE जैसे स्टेटमेंट का आउटपुट नहीं दिखता। इसे चालू करने से डिबगिंग और परिणाम देखने में मदद मिलती है।

English: In PL/SQL, SET Serveroutput ON is used to enable the display of output from the server to the client (e.g., SQL*Plus). Without it, output from statements like DBMS_OUTPUT.PUT_LINE is not shown. Turning it on helps in debugging and viewing results.

8) स्पेस जटिलता क्या है? इसकी गणना कैसे की जाती है? [2]

What is Space Complexity? How can we calculate it?

स्पेस जटिलता (Space Complexity): यह किसी एल्गोरिथ्म द्वारा अपने निष्पादन के दौरान आवश्यक कुल मेमोरी स्थान की मात्रा है। इसमें इनपुट डेटा, आउटपुट डेटा और अस्थायी चरों के लिए आवश्यक स्थान शामिल होता है।

गणना: स्पेस जटिलता की गणना इनपुट आकार (n) के फलन के रूप में की जाती है। इसे S(n) = C + SP(n) के रूप में व्यक्त किया जाता है, जहाँ C स्थिर स्थान (कोड, स्थिरांक) है और SP(n) इनपुट आकार पर निर्भर परिवर्तनशील स्थान है।

9) दो आयामी ऐरे में पता गणना को समझाइए। [2]

Explain the address calculation in 2-D array.

दो आयामी ऐरे में पता गणना दो मुख्य तरीकों से की जाती है:

  • रो-मेजर ऑर्डर (Row-major order): पंक्ति दर पंक्ति डेटा संग्रहीत होता है। किसी तत्व A[i][j] का पता = बेस पता + [(i - LB1) × (कॉलमों की संख्या) + (j - LB2)] × तत्व का आकार
  • कॉलम-मेजर ऑर्डर (Column-major order): स्तंभ दर स्तंभ डेटा संग्रहीत होता है। किसी तत्व A[i][j] का पता = बेस पता + [(j - LB2) × (पंक्तियों की संख्या) + (i - LB1)] × तत्व का आकार

जहाँ LB1 और LB2 क्रमशः पंक्ति और स्तंभ की निचली सीमाएँ हैं।

20) स्टैक के बुनियादी ऑपरेशन बताइए। [2]

Explain the basic operations of stack.

स्टैक के बुनियादी ऑपरेशन निम्नलिखित हैं:

  • Push: स्टैक के शीर्ष पर एक नया तत्व जोड़ना।
  • Pop: स्टैक के शीर्ष से तत्व को हटाना।
  • Peek/Top: स्टैक के शीर्ष तत्व को बिना हटाए देखना।
  • isEmpty: जाँचना कि स्टैक खाली है या नहीं।
  • isFull: जाँचना कि स्टैक भरा है या नहीं (सीमित आकार के स्टैक के लिए)।

21) अडैप्टिव व नॉन-अडैप्टिव सॉर्टिंग एल्गोरिथ्म में अन्तर बताइए। [2]

Differentiate between Adaptive and Non-adaptive Sorting algorithms.

अडैप्टिव सॉर्टिंग नॉन-अडैप्टिव सॉर्टिंग
यह इनपुट डेटा के क्रम पर निर्भर करता है। यदि डेटा पहले से आंशिक रूप से सॉर्टेड है, तो यह तेज़ी से काम करता है। यह इनपुट डेटा के क्रम पर निर्भर नहीं करता। सभी स्थितियों में समान समय लेता है।
उदाहरण: इंसर्शन सॉर्ट, बबल सॉर्ट (अनुकूलित संस्करण) उदाहरण: सेलेक्शन सॉर्ट, मर्ज सॉर्ट, हीप सॉर्ट

22) स्टेटिक डेटा मैम्बर्स की विशेषताएं क्या हैं? [2]

What are the features of Static data Members?

  • स्टेटिक डेटा मैम्बर क्लास के सभी ऑब्जेक्ट्स के बीच साझा (shared) होता है।
  • इसे क्लास के नाम और स्कोप रेज़ोल्यूशन ऑपरेटर (::) का उपयोग करके एक्सेस किया जाता है।
  • यह क्लास के किसी भी ऑब्जेक्ट के बनने से पहले ही मेमोरी में आवंटित हो जाता है।
  • इसे क्लास के बाहर अलग से परिभाषित (define) करना आवश्यक होता है।
  • स्टेटिक डेटा मैम्बर की केवल एक प्रति (copy) होती है, चाहे कितने भी ऑब्जेक्ट बनाए जाएँ।

23) क्लास के मैम्बर फंक्शन को एक्सेस करने के लिए प्रारूप लिखिए। [2]

Write the syntax for accessing the Member function of a class.

क्लास के मैम्बर फंक्शन को एक्सेस करने का प्रारूप (syntax) निम्नलिखित है:

object_name.function_name(arguments);

उदाहरण:

MyClass obj;
obj.display();

यदि पॉइंटर का उपयोग कर रहे हैं, तो:

MyClass *ptr = new MyClass();
ptr->display();

24) आप फंक्शन ओवरलोडिंग से क्या समझते हैं? [2]

What do you understand by function overloading?

फंक्शन ओवरलोडिंग (Function Overloading): यह C++ की एक विशेषता है जिसमें एक ही नाम के कई फंक्शन बनाए जा सकते हैं, लेकिन उनके पैरामीटर (संख्या, प्रकार, या क्रम) भिन्न होते हैं। कंपाइलर पैरामीटर के आधार पर यह निर्धारित करता है कि कौन सा फंक्शन कॉल किया जाना चाहिए।

उदाहरण:

int add(int a, int b);
float add(float a, float b);
int add(int a, int b, int c);

यह प्रोग्राम की पठनीयता और लचीलापन बढ़ाता है।

खण्ड - C

SECTION - C

25) चयन सॉर्ट को उदाहरण सहित समझाईए। [3]

Explain selection sort with example.

उत्तर: चयन सॉर्ट (Selection Sort) एक सरल सॉर्टिंग एल्गोरिथ्म है जो सूची को दो भागों में विभाजित करता है: सॉर्टेड और अनसॉर्टेड। यह बार-बार अनसॉर्टेड भाग से सबसे छोटा (या सबसे बड़ा) तत्व ढूंढता है और उसे सॉर्टेड भाग के अंत में रखता है।

उदाहरण: मान लीजिए एक ऐरे [64, 25, 12, 22, 11] है।

  • पहला पास: सबसे छोटा तत्व 11 है, इसे 64 से बदलें → [11, 25, 12, 22, 64]
  • दूसरा पास: शेष [25, 12, 22, 64] में सबसे छोटा 12 है, इसे 25 से बदलें → [11, 12, 25, 22, 64]
  • तीसरा पास: शेष [25, 22, 64] में सबसे छोटा 22 है, इसे 25 से बदलें → [11, 12, 22, 25, 64]
  • चौथा पास: शेष [25, 64] में सबसे छोटा 25 है, कोई बदलाव नहीं → [11, 12, 22, 25, 64]

अंतिम सॉर्टेड ऐरे: [11, 12, 22, 25, 64]

26) कॉल बाई रेफरेंस से आप क्या समझते हैं? उदाहरण सहित समझाईए। [3]

What do you understand by call by reference? Explain with example.

उत्तर: कॉल बाई रेफरेंस (Call by Reference) एक फंक्शन आर्गुमेंट पास करने की विधि है जिसमें वेरिएबल की वास्तविक मेमोरी लोकेशन (एड्रेस) को फंक्शन में भेजा जाता है। फंक्शन में किए गए बदलाव मूल वेरिएबल को प्रभावित करते हैं।

उदाहरण (C भाषा में):

#include <stdio.h>
void swap(int *a, int *b) {
    int temp = *a;
    *a = *b;
    *b = temp;
}
int main() {
    int x = 10, y = 20;
    printf("पहले: x=%d, y=%d\n", x, y);
    swap(&x, &y);
    printf("बाद में: x=%d, y=%d\n", x, y);
    return 0;
}

आउटपुट: पहले: x=10, y=20; बाद में: x=20, y=10

यहाँ &x और &y (एड्रेस) पास किए गए हैं, इसलिए swap फंक्शन में बदलाव मूल वेरिएबल्स को प्रभावित करते हैं।

27) निम्न डाटाबेस विसंगतियों को समझाईए: [3]

Explain following database anomalies:

  1. अपडेट (Update)
  2. इन्सर्सन (Insertion)
  3. डिलीशन (Deletion)

उत्तर: डाटाबेस विसंगतियाँ (Anomalies) तब उत्पन्न होती हैं जब डाटाबेस डिज़ाइन ठीक से सामान्यीकृत (Normalized) नहीं होता। ये तीन प्रकार की होती हैं:

  • क) अपडेट विसंगति (Update Anomaly): जब एक ही डेटा को कई स्थानों पर अपडेट करना पड़ता है और कुछ स्थान छूट जाते हैं, जिससे डेटा असंगत हो जाता है। उदाहरण: एक कर्मचारी का पता कई रिकॉर्ड में है, लेकिन केवल एक को अपडेट किया गया।
  • ख) इन्सर्सन विसंगति (Insertion Anomaly): जब किसी नए डेटा को डालने के लिए आवश्यक अन्य डेटा उपलब्ध न हो। उदाहरण: एक नए कोर्स को डालने के लिए कम से कम एक छात्र का होना आवश्यक है।
  • ग) डिलीशन विसंगति (Deletion Anomaly): जब किसी डेटा को हटाने पर अन्य आवश्यक डेटा भी अनजाने में हट जाता है। उदाहरण: एक छात्र को हटाने पर उसके द्वारा लिए गए कोर्स की जानकारी भी हट जाती है।

28) मर्ज सॉर्ट को उदाहरण सहित समझाईए। [4]

Explain Merge Sort with example.

अथवा / OR

'C' में रिकर्शन को उदाहरण के साथ समझाईए।

Explain recursion in 'C' with example.

उत्तर (मर्ज सॉर्ट): मर्ज सॉर्ट (Merge Sort) एक Divide and Conquer एल्गोरिथ्म है जो सूची को बार-बार दो भागों में विभाजित करता है जब तक प्रत्येक भाग में एक तत्व न रह जाए, फिर उन्हें क्रमबद्ध रूप से मर्ज करता है।

उदाहरण: ऐरे [38, 27, 43, 3, 9, 82, 10] पर मर्ज सॉर्ट:

  • विभाजन: [38, 27, 43, 3] और [9, 82, 10]
  • आगे विभाजन: [38, 27] [43, 3] [9, 82] [10]
  • अंतिम विभाजन: [38] [27] [43] [3] [9] [82] [10]
  • मर्जिंग: [27, 38] [3, 43] [9, 82] [10] → [3, 27, 38, 43] [9, 10, 82] → [3, 9, 10, 27, 38, 43, 82]

अंतिम सॉर्टेड ऐरे: [3, 9, 10, 27, 38, 43, 82]


अथवा उत्तर (रिकर्शन): रिकर्शन (Recursion) एक प्रोग्रामिंग तकनीक है जिसमें कोई फंक्शन स्वयं को कॉल करता है। इसमें एक बेस केस होता है जो रिकर्शन को रोकता है।

उदाहरण (C में फैक्टोरियल):

#include <stdio.h>
int factorial(int n) {
    if (n == 0)  // बेस केस
        return 1;
    else
        return n * factorial(n - 1);  // रिकर्सिव कॉल
}
int main() {
    int num = 5;
    printf("%d का फैक्टोरियल = %d\n", num, factorial(num));
    return 0;
}

आउटपुट: 5 का फैक्टोरियल = 120

यहाँ factorial(5) → 5 * factorial(4) → 5 * 4 * factorial(3) → ... → 5 * 4 * 3 * 2 * 1 * factorial(0) = 120

29) SQL में अग्रीगेट फंक्शन से क्या समझते हैं? अग्रीगेट फंक्शन्स को निम्न स्कीमा द्वारा समझाइए। [4]

Teacher (T.name, salary, age, dob)

What do you understand by aggregate function in SQL? Explain aggregate function on following Schema.

Teacher (T.name, salary, age, dob)

अग्रीगेट फंक्शन (Aggregate Functions): SQL में अग्रीगेट फंक्शन वे फंक्शन होते हैं जो एक से अधिक पंक्तियों (rows) के मानों पर कार्य करके एक एकल मान (single value) लौटाते हैं। ये फंक्शन डेटा के समूह पर गणना करने के लिए उपयोग किए जाते हैं, जैसे कुल योग, औसत, अधिकतम, न्यूनतम, और गणना।

उदाहरण (Teacher स्कीमा पर):

  • COUNT(): शिक्षकों की कुल संख्या ज्ञात करना।
    SELECT COUNT(*) FROM Teacher;
  • SUM(): सभी शिक्षकों के वेतन का योग।
    SELECT SUM(salary) FROM Teacher;
  • AVG(): शिक्षकों के वेतन का औसत।
    SELECT AVG(salary) FROM Teacher;
  • MAX(): अधिकतम वेतन वाले शिक्षक का वेतन।
    SELECT MAX(salary) FROM Teacher;
  • MIN(): न्यूनतम वेतन वाले शिक्षक का वेतन।
    SELECT MIN(salary) FROM Teacher;

अथवा / OR

निम्न को E-R आरेख में समझाइए।

क) डराईवड एट्रीब्यूट (Derived Attribute)
ख) पार्टीसिपेशन कांस्ट्रेंट्स (Participation Constraints)
ग) की कांस्ट्रेंट्स (Key Constraints)

Explain following in E-R diagram:
a) Derived attribute
b) Participation constraints
c) Key constraints

क) डराईवड एट्रीब्यूट (Derived Attribute): यह वह एट्रीब्यूट है जिसका मान अन्य एट्रीब्यूट्स से गणना करके प्राप्त किया जाता है। E-R आरेख में इसे डैश (dashed) अंडाकार (ellipse) से दर्शाया जाता है। उदाहरण: Teacher एंटिटी में "age" एक डराईवड एट्रीब्यूट हो सकता है, जिसकी गणना "dob" (जन्म तिथि) से की जाती है।

ख) पार्टीसिपेशन कांस्ट्रेंट्स (Participation Constraints): यह बताता है कि किसी रिलेशनशिप में एंटिटी की भागीदारी अनिवार्य (total) है या वैकल्पिक (partial)। Total participation को डबल लाइन (double line) से और partial participation को सिंगल लाइन से दर्शाया जाता है। उदाहरण: यदि प्रत्येक शिक्षक किसी न किसी विभाग में कार्यरत है, तो Teacher की भागीदारी total होगी।

ग) की कांस्ट्रेंट्स (Key Constraints): यह बताता है कि किसी एंटिटी को विशिष्ट रूप से पहचानने के लिए कौन से एट्रीब्यूट्स का उपयोग किया जाता है। E-R आरेख में प्राथमिक की (primary key) को अंडरलाइन (underline) करके दर्शाया जाता है। उदाहरण: Teacher एंटिटी में "T.name" प्राथमिक की हो सकता है।


30) मल्टीपल इनहेरिटेंस को उदाहरण सहित समझाइए। [4]

Explain Multiple Inheritance with example.

मल्टीपल इनहेरिटेंस (Multiple Inheritance): यह C++ की एक विशेषता है जिसमें एक डिराइव्ड क्लास एक से अधिक बेस क्लासेस से गुण (properties) और विधियाँ (methods) प्राप्त कर सकता है।

उदाहरण:

class Student {
public:
    int roll_no;
    void display_roll() {
        cout << "Roll No: " << roll_no << endl;
    }
};

class Marks {
public:
    int marks;
    void display_marks() {
        cout << "Marks: " << marks << endl;
    }
};

// Multiple Inheritance
class Result : public Student, public Marks {
public:
    void display_result() {
        display_roll();
        display_marks();
        cout << "Total: " << (marks) << endl;
    }
};

int main() {
    Result r;
    r.roll_no = 101;
    r.marks = 85;
    r.display_result();
    return 0;
}

व्याख्या: उपरोक्त उदाहरण में, Result क्लास Student और Marks दोनों बेस क्लासेस से इनहेरिट करता है, जिससे वह दोनों के गुणों (roll_no और marks) और विधियों का उपयोग कर सकता है।

अथवा / OR

C++ में कंस्ट्रक्टर ओवरलोडिंग को समझाने के लिए एक प्रोग्राम लिखिए।

Write a C++ Program to explain Constructor overloading.

कंस्ट्रक्टर ओवरलोडिंग (Constructor Overloading): C++ में कंस्ट्रक्टर ओवरलोडिंग का अर्थ है एक ही क्लास में अलग-अलग पैरामीटर लिस्ट वाले एक से अधिक कंस्ट्रक्टर परिभाषित करना। यह ऑब्जेक्ट को विभिन्न तरीकों से इनिशियलाइज़ करने की अनुमति देता है।

प्रोग्राम:

#include <iostream>
using namespace std;

class Rectangle {
private:
    int length, breadth;
public:
    // Default Constructor
    Rectangle() {
        length = 0;
        breadth = 0;
    }
    // Parameterized Constructor with one parameter
    Rectangle(int side) {
        length = side;
        breadth = side;
    }
    // Parameterized Constructor with two parameters
    Rectangle(int l, int b) {
        length = l;
        breadth = b;
    }
    void display() {
        cout << "Length: " << length << ", Breadth: " << breadth << endl;
    }
};

int main() {
    Rectangle r1;          // Calls default constructor
    Rectangle r2(5);       // Calls one-parameter constructor
    Rectangle r3(10, 20);  // Calls two-parameter constructor

    cout << "Rectangle 1: ";
    r1.display();
    cout << "Rectangle 2: ";
    r2.display();
    cout << "Rectangle 3: ";
    r3.display();

    return 0;
}

व्याख्या: उपरोक्त प्रोग्राम में Rectangle क्लास में तीन कंस्ट्रक्टर हैं: एक बिना पैरामीटर (default), एक एक पैरामीटर (वर्गाकार आयत के लिए), और एक दो पैरामीटर (आयत के लिए)। main() फंक्शन में अलग-अलग ऑब्जेक्ट बनाकर प्रत्येक कंस्ट्रक्टर को कॉल किया गया है।