RBSE Class 12th 2020 -SS-03-2020 Previous Year Papers

-SS-03-2020 from the 2020 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 2020
Subject -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 -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 -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 -SS-03-2020

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

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

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

सूचना प्रौद्योगिकी और प्रोग्रामिंग-ए

(INFORMATION TECHNOLOGY AND PROGRAMMING-I)

Ufes (Optional)

उच्च माध्यमिक परीक्षा, 2020

समय : 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.

SS-03-Info.Tech. (Opt.) [ Turn over

निर्देश / Instructions

  1. जिन प्रश्नों में आन्तरिक खण्ड हैं, उन सभी के उत्तर एक साथ ही लिखें।

    For questions having more than one part, the answers to those parts are to be written together in continuity.

  2. प्रश्न-पत्र के हिन्दी व अंग्रेजी रूपांतर में किसी प्रकार की त्रुटि/अंतर/विरोधाभास होने पर हिन्दी भाषा के प्रश्न को ही सही मानें।

    If there is any error / difference / contradiction in Hindi & English versions of the question paper, the question of Hindi version should be treated valid.

खण्ड / Section

खण्ड (Section) प्रश्न संख्या (Q. Nos.) अंक प्रति प्रश्न (Marks per question)
अ (A) 1-3 1
ब (B) 4-24 2
स (C) 25-27 3
द (D) 28-30 4

प्रश्न संख्या 28, 29 व 30 में आंतरिक विकल्प हैं।

Question Nos. 28, 29 and 30 have internal choices.


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

खण्ड -अ
SECTION-A

  1. अरेखीय डाटा स्ट्रक्चर के कोई दो उदाहरण लिखिए |
    Write any two examples of non-linear data structure.

    अरेखीय डाटा स्ट्रक्चर के दो उदाहरण हैं:

    1. ट्री (Tree)
    2. ग्राफ (Graph)

    Two examples of non-linear data structure are:

    1. Tree
    2. Graph
  2. सूचक क्या होता है ?
    What is Pointer ?

    सूचक (Pointer) एक वेरिएबल है जो किसी अन्य वेरिएबल के मेमोरी एड्रेस को संग्रहीत करता है। यह डायरेक्ट मेमोरी एक्सेस की अनुमति देता है।

    A pointer is a variable that stores the memory address of another variable. It allows direct memory access.

  3. त्वरित क्रमबद्ध एल्गोरिथ्म की जटिलता क्या होती है ?
    What is the complexity of quick sort algorithm ?

    त्वरित क्रमबद्ध (Quick Sort) एल्गोरिथ्म की समय जटिलता:

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

    The time complexity of Quick Sort algorithm:

    • Best case: O(n log n)
    • Average case: O(n log n)
    • Worst case: O(n²)
  4. Fem में पॉप ऑपरेशन कया होता है ?
    What is POP operation in stack ?

    पॉप (POP) ऑपरेशन स्टैक से सबसे ऊपरी तत्व (Top element) को हटाने की क्रिया है। यह LIFO (Last In First Out) सिद्धांत पर काम करता है।

    POP operation is the process of removing the topmost element from the stack. It works on the LIFO (Last In First Out) principle.

  5. सरक्युलर लिंक्ड लिस्ट को परिभाषित करें |
    Define circular linked list.

    सरक्युलर लिंक्ड लिस्ट (Circular Linked List) एक लिंक्ड लिस्ट है जिसमें अंतिम नोड का अगला पॉइंटर पहले नोड को इंगित करता है, जिससे एक वृत्ताकार श्रृंखला बनती है। इसमें कोई NULL पॉइंटर नहीं होता।

    A circular linked list is a linked list in which the last node's next pointer points to the first node, forming a circular chain. There is no NULL pointer in it.

  6. टोकन्स क्या होते हैं ?
    What are tokens ?

    टोकन्स (Tokens) प्रोग्रामिंग भाषा में सबसे छोटी इकाइयाँ होती हैं जिन्हें कंपाइलर पहचानता है। ये कीवर्ड, आइडेंटिफायर, कॉन्स्टेंट, स्ट्रिंग लिटरल, ऑपरेटर और पंक्चुएटर हो सकते हैं।

    Tokens are the smallest units in a programming language that a compiler recognizes. They can be keywords, identifiers, constants, string literals, operators, and punctuators.

7. एक्सप्रेशंस क्या होते हैं ?

What are expressions ?

उत्तर: एक्सप्रेशंस (Expressions) वे संयोजन होते हैं जिनमें ऑपरेंड (variables, constants) और ऑपरेटर (जैसे +, -, *, /) शामिल होते हैं, जिनका मूल्यांकन करके एक मान प्राप्त किया जाता है। उदाहरण: a + b * 5 एक एक्सप्रेशन है।

8. इनलाइन फंक्शन क्या होता है ?

What is inline function ?

उत्तर: इनलाइन फंक्शन (Inline function) एक ऐसा फंक्शन होता है जिसे कंपाइलर द्वारा कॉल के स्थान पर उसके कोड को सीधे प्रतिस्थापित (substitute) कर दिया जाता है, जिससे फंक्शन कॉल का ओवरहेड समाप्त हो जाता है और प्रोग्राम की गति बढ़ जाती है। इसे inline कीवर्ड से घोषित किया जाता है।

9. क्लास को परिभाषित करें।

Define Class.

उत्तर: क्लास (Class) एक उपयोगकर्ता-परिभाषित डेटा प्रकार है जो डेटा सदस्यों (data members) और सदस्य फंक्शन्स (member functions) को एक इकाई में समाहित करता है। यह ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग की मूलभूत अवधारणा है। उदाहरण:

class Student {
    int rollNo;
    string name;
public:
    void display() {
        cout << rollNo << " " << name;
    }
};

10. कंस्ट्रक्टर ओवरलोडिंग किसे कहते हैं ?

What is constructor overloading ?

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

11. ऑपरेटर फंक्शन के प्रोटोटाइप को ऑपरेटर ओवरलोडिंग के संदर्भ में लिखिए।

Write the prototype of operator function in operator overloading.

उत्तर: ऑपरेटर फंक्शन का प्रोटोटाइप निम्न प्रकार होता है:

return_type operator operator_symbol (argument_list);

उदाहरण के लिए, यदि हम + ऑपरेटर को ओवरलोड करना चाहते हैं तो प्रोटोटाइप होगा:

ClassName operator+(const ClassName &obj);

यहाँ return_type फंक्शन द्वारा लौटाया गया मान है, operator_symbol वह ऑपरेटर है जिसे ओवरलोड किया जा रहा है, और argument_list में पैरामीटर होते हैं।

12. हाइब्रिड इनहेरिटेंस क्या होता है ?

What is Hybrid inheritance ?

उत्तर: हाइब्रिड इनहेरिटेंस (Hybrid inheritance) दो या दो से अधिक प्रकार की इनहेरिटेंस (जैसे सिंगल, मल्टीपल, मल्टीलेवल, हाइरार्किकल) का संयोजन होता है। इसमें एक से अधिक बेस क्लास से डिराइव्ड क्लास बनाई जाती है, जिससे डायमंड प्रॉब्लम (diamond problem) उत्पन्न हो सकती है, जिसे वर्चुअल बेस क्लास (virtual base class) का उपयोग करके हल किया जाता है।

13. DBMS में DDL (डी.डी.एल.) और DML (डी.एम.एल.) का पूरा नाम क्या होता है ?

What is the full form of DDL and DML in DBMS ?

उत्तर:

  • DDL: Data Definition Language (डेटा डेफिनिशन लैंग्वेज) – इसका उपयोग डेटाबेस की संरचना (जैसे टेबल, इंडेक्स) को बनाने, बदलने या हटाने के लिए किया जाता है।
  • DML: Data Manipulation Language (डेटा मैनिपुलेशन लैंग्वेज) – इसका उपयोग डेटाबेस में डेटा को जोड़ने, हटाने, अद्यतन करने या पुनर्प्राप्त करने के लिए किया जाता है।

खण्ड-ब / SECTION - B

  1. PL/SQL खंड की बनावट को लिखिए।

    Write the structure of PL/SQL block. [2]

    PL/SQL ब्लॉक की बनावट (Structure) निम्नलिखित है:

    DECLARE
       -- Declaration section (optional)
       -- Variables, constants, cursors, exceptions
    BEGIN
       -- Executable section (mandatory)
       -- SQL and PL/SQL statements
    EXCEPTION
       -- Exception handling section (optional)
       -- Handle errors
    END;
          

    व्याख्या: PL/SQL ब्लॉक में तीन भाग होते हैं: DECLARE (घोषणा खंड, वैकल्पिक), BEGIN...END (निष्पादन खंड, अनिवार्य), और EXCEPTION (अपवाद प्रबंधन खंड, वैकल्पिक)।

  2. MySQL में कोई चार Aggregate फंक्शन के नाम लिखें।

    Write any four Aggregate functions in MySQL. [2]

    MySQL में चार Aggregate फंक्शन निम्नलिखित हैं:

    1. COUNT() – पंक्तियों की संख्या गिनता है।
    2. SUM() – किसी कॉलम के मानों का योग निकालता है।
    3. AVG() – किसी कॉलम के मानों का औसत निकालता है।
    4. MAX() – किसी कॉलम का अधिकतम मान लौटाता है।

    व्याख्या: Aggregate फंक्शन एक से अधिक पंक्तियों पर कार्य करके एक एकल मान लौटाते हैं।

  3. REVOKE कमांड का MySQL में क्या उपयोग है?

    What is the use of REVOKE command in MySQL? [2]

    REVOKE कमांड का उपयोग MySQL में किसी उपयोगकर्ता या भूमिका (role) से पहले दिए गए विशेषाधिकारों (privileges) को वापस लेने के लिए किया जाता है।

    उदाहरण: REVOKE SELECT ON database_name.* FROM 'user'@'host';

    व्याख्या: यह कमांड डेटाबेस सुरक्षा प्रबंधन में महत्वपूर्ण है, जिससे अनधिकृत पहुँच को रोका जा सकता है।

  4. एक खराब डेटाबेस क्या होता है?

    What is a bad database? [2]

    खराब डेटाबेस (Bad Database) वह डेटाबेस होता है जो निम्नलिखित समस्याओं से ग्रस्त हो:

    • डेटा रिडंडेंसी (Data Redundancy) – एक ही डेटा कई स्थानों पर दोहराया जाता है।
    • असंगति (Inconsistency) – डेटा में विरोधाभास होता है।
    • अपडेट विसंगतियाँ (Update Anomalies) – डेटा अपडेट करने में कठिनाई होती है।
    • सम्मिलन विसंगतियाँ (Insertion Anomalies) – नया डेटा जोड़ने में समस्या होती है।
    • विलोपन विसंगतियाँ (Deletion Anomalies) – डेटा हटाने पर अन्य महत्वपूर्ण डेटा भी हट जाता है।

    व्याख्या: एक खराब डेटाबेस सामान्यतः अनॉर्मलाइज़्ड (unnormalized) होता है और इसमें डेटा अखंडता (data integrity) बनाए रखना कठिन होता है।

  5. Malloc फंक्शन की उपयोगिता समझाइए।

    Explain the use of Malloc function. [2]

    malloc() फंक्शन C भाषा में डायनामिक मेमोरी आवंटन (dynamic memory allocation) के लिए उपयोग किया जाता है।

    उपयोगिता:

    • यह रन-टाइम पर मेमोरी आवंटित करता है, जिससे मेमोरी का कुशल उपयोग होता है।
    • यह stdlib.h हेडर फाइल में परिभाषित होता है।
    • सिंटैक्स: void* malloc(size_t size); – यह आकार (size) के अनुसार बाइट्स आवंटित करता है और एक पॉइंटर लौटाता है।
    • यदि मेमोरी आवंटन विफल होता है, तो यह NULL लौटाता है।

    उदाहरण: int *ptr = (int*)malloc(5 * sizeof(int));

    व्याख्या: malloc() का उपयोग तब किया जाता है जब मेमोरी की आवश्यकता प्रोग्राम चलने के दौरान निर्धारित होती है, जैसे कि डायनामिक ऐरे या लिंक्ड लिस्ट बनाने में।

  6. स्टेबल और अनस्टेबल सॉर्टिंग में अंतर लिखिए।

    Write the differences between stable and unstable sorting. [2]

    स्टेबल सॉर्टिंग (Stable Sorting) अनस्टेबल सॉर्टिंग (Unstable Sorting)
    समान कुंजी (equal keys) वाले तत्वों का मूल क्रम बना रहता है। समान कुंजी वाले तत्वों का मूल क्रम बदल सकता है।
    उदाहरण: Bubble Sort, Insertion Sort, Merge Sort उदाहरण: Selection Sort, Quick Sort, Heap Sort
    अधिक स्थिरता (stability) की आवश्यकता वाले अनुप्रयोगों में उपयोगी। जहाँ स्थिरता महत्वपूर्ण नहीं है, वहाँ उपयोग किया जाता है।
    आमतौर पर अधिक मेमोरी या समय ले सकता है। अक्सर तेज़ और कम मेमोरी उपयोग करता है।

    व्याख्या: स्टेबल सॉर्टिंग में समान तत्वों का क्रम संरक्षित रहता है, जबकि अनस्टेबल सॉर्टिंग में यह आवश्यक नहीं है।

20. इन्फिक्स नोटेशन को उदाहरण सहित समझाइए |

Explain infix notation with example.

इन्फिक्स नोटेशन (Infix Notation): इसमें ऑपरेटर को ऑपरेंड के बीच में लिखा जाता है। यह सामान्य गणितीय अभिव्यक्ति का रूप है।

उदाहरण: A + B, (A + B) * C, X / Y - Z

इसमें ऑपरेटर (+ , - , * , /) ऑपरेंड (A, B, C) के बीच में आता है।

21. लिंक्ड लिस्ट में नोड और नेक्स्ट क्या होते हैं ?

What is node and next in linked list ?

नोड (Node): लिंक्ड लिस्ट का मूलभूत घटक है। प्रत्येक नोड में दो भाग होते हैं:

  • डेटा (Data): इसमें वास्तविक जानकारी संग्रहीत होती है।
  • नेक्स्ट (Next): यह एक पॉइंटर है जो लिस्ट में अगले नोड का पता (एड्रेस) रखता है।

नेक्स्ट (Next): यह एक पॉइंटर है जो लिंक्ड लिस्ट में अगले नोड को इंगित करता है। अंतिम नोड का नेक्स्ट NULL होता है, जो लिस्ट के अंत को दर्शाता है।

22. फंक्शन में कॉल-बाय-रेफरेंस को समझाइए |

Explain call-by-reference in functions.

कॉल-बाय-रेफरेंस (Call by Reference): इस विधि में फंक्शन को तर्क के रूप में वेरिएबल का एड्रेस (पता) भेजा जाता है। फंक्शन में पैरामीटर को रेफरेंस (&) के रूप में घोषित किया जाता है।

विशेषताएं:

  • फंक्शन में किए गए बदलाव मूल वेरिएबल को प्रभावित करते हैं।
  • मेमोरी की बचत होती है क्योंकि वेरिएबल की कॉपी नहीं बनती।
  • बड़े डेटा स्ट्रक्चर के लिए उपयोगी है।

उदाहरण (C++):

void swap(int &a, int &b) {
    int temp = a;
    a = b;
    b = temp;
}
int main() {
    int x = 10, y = 20;
    swap(x, y);  // x=20, y=10 हो जाएगा
}

23. स्टेटिक मेम्बर फंक्शन के क्या गुण होते हैं ?

What are the properties of static member function ?

स्टेटिक मेम्बर फंक्शन के गुण (Properties of Static Member Function):

  1. यह क्लास के नाम से सीधे कॉल किया जा सकता है, ऑब्जेक्ट की आवश्यकता नहीं।
  2. यह केवल स्टेटिक डेटा मेम्बर्स और अन्य स्टेटिक मेम्बर फंक्शन्स को ही एक्सेस कर सकता है।
  3. इसमें this पॉइंटर नहीं होता क्योंकि यह किसी विशेष ऑब्जेक्ट से संबंधित नहीं है।
  4. इसे static कीवर्ड से घोषित किया जाता है।
  5. यह क्लास के सभी ऑब्जेक्ट्स के लिए साझा (shared) होता है।

24. PL/SQL कर्सर क्या होता है ?

What is PL/SQL cursor ?

PL/SQL कर्सर (Cursor): यह एक डेटाबेस ऑब्जेक्ट है जो SQL क्वेरी के परिणामों को एक-एक करके प्रोसेस करने के लिए उपयोग किया जाता है। कर्सर एक अस्थायी मेमोरी एरिया (context area) को पॉइंट करता है जिसमें SQL स्टेटमेंट का परिणाम संग्रहीत होता है।

प्रकार:

  • इम्प्लिसिट कर्सर (Implicit Cursor): Oracle द्वारा स्वचालित रूप से बनाया जाता है जब DML स्टेटमेंट (INSERT, UPDATE, DELETE) निष्पादित होता है।
  • एक्सप्लिसिट कर्सर (Explicit Cursor): प्रोग्रामर द्वारा बनाया जाता है जब SELECT क्वेरी एक से अधिक पंक्तियाँ लौटाती है।

खण्ड-स (Section-C)

25. एक ऐरे X[-5 ..... 0, 5 ..... 40] जिसमें एक बाइट स्टोरेज की आवश्यकता है। अगर शुरुआती लोकेशन 500 है, तो X[5][20] की लोकेशन कॉलम मेजर प्रणाली से ज्ञात कीजिए।

An array X[-5 ..... 0, 5 ..... 40] requires one byte of storage. If beginning location is 500, determine the location of X[5][20] using column major system.

हल (Solution):

दिया गया है:

  • पहला डायमेंशन (पंक्ति): L1 = -5 से U1 = 0 तक
  • दूसरा डायमेंशन (स्तंभ): L2 = 5 से U2 = 40 तक
  • प्रत्येक तत्व का आकार (Size) = 1 बाइट
  • बेस एड्रेस (Base Address) = 500
  • तत्व का पता ज्ञात करना है: X[5][20]

कॉलम मेजर सिस्टम (Column Major System) का सूत्र:

Address(X[i][j]) = Base + Size × [(j - L2) × (U1 - L1 + 1) + (i - L1)]

यहाँ:

  • i = 5, j = 20
  • L1 = -5, U1 = 0
  • L2 = 5, U2 = 40
  • पंक्तियों की संख्या = U1 - L1 + 1 = 0 - (-5) + 1 = 6
  • स्तंभों की संख्या = U2 - L2 + 1 = 40 - 5 + 1 = 36

गणना:

Address = 500 + 1 × [(20 - 5) × 6 + (5 - (-5))]

= 500 + [15 × 6 + 10]

= 500 + [90 + 10]

= 500 + 100

= 600

अतः X[5][20] की लोकेशन 600 है।

26. SQL में GROUP BY क्लॉज का उपयोग उदाहरण सहित समझाइए।

Explain the use of GROUP BY clause in SQL with example.

GROUP BY क्लॉज का उपयोग SQL में समान मान वाले पंक्तियों को समूहित करने के लिए किया जाता है। इसका उपयोग प्रायः एग्रीगेट फंक्शन्स (जैसे COUNT, SUM, AVG, MAX, MIN) के साथ किया जाता है ताकि प्रत्येक समूह पर गणना की जा सके।

उदाहरण: मान लीजिए हमारे पास एक Student तालिका है:

RollNo Name City Marks
101RaviJaipur85
102SitaJodhpur90
103MohanJaipur78
104GeetaJodhpur92

प्रश्न: प्रत्येक शहर में छात्रों की संख्या ज्ञात करें।

SELECT City, COUNT(*) AS TotalStudents
FROM Student
GROUP BY City;

परिणाम:

City TotalStudents
Jaipur2
Jodhpur2

इस प्रकार GROUP BY क्लॉज डेटा को समूहित करके सारांश रिपोर्ट तैयार करने में सहायक होता है।

27. डेटाबेस में कार्यात्मक निर्भरता (Functional Dependencies) को समझाइए।

Explain functional dependencies in database.

कार्यात्मक निर्भरता (Functional Dependency) एक संबंध है जो डेटाबेस में दो एट्रीब्यूट सेट के बीच परिभाषित होता है। यह बताता है कि यदि हम एक एट्रीब्यूट (या एट्रीब्यूट समूह) का मान जानते हैं, तो हम दूसरे एट्रीब्यूट का मान निर्धारित कर सकते हैं।

संकेतन: X → Y (X कार्यात्मक रूप से Y को निर्धारित करता है)

उदाहरण: एक Employee तालिका में:

  • EmpID → EmpName (यदि EmpID ज्ञात है, तो EmpName निर्धारित किया जा सकता है)
  • EmpID → Salary (EmpID से Salary का मान ज्ञात होता है)

महत्व: कार्यात्मक निर्भरता डेटाबेस नॉर्मलाइजेशन में सहायक होती है, जिससे डेटा रिडंडेंसी कम होती है और डेटा इंटीग्रिटी बनी रहती है।

28. लीनियर सर्च को उदाहरण सहित समझाइए।

Explain Linear Search with example.

लीनियर सर्च एक सरल खोज एल्गोरिथ्म है जो किसी सूची में तत्व को क्रमिक रूप से खोजता है। यह प्रत्येक तत्व की तुलना लक्ष्य मान से करता है जब तक मिलान न हो जाए या सूची समाप्त न हो जाए।

उदाहरण: मान लीजिए एक ऐरे arr = [10, 25, 30, 45, 50] है और हमें 30 खोजना है।

  1. पहला तत्व 10 ≠ 30 → आगे बढ़ें
  2. दूसरा तत्व 25 ≠ 30 → आगे बढ़ें
  3. तीसरा तत्व 30 = 30 → मिलान, इंडेक्स 2 पर मिला

समय जटिलता: सबसे खराब स्थिति में O(n), जहाँ n तत्वों की संख्या है।

28. (OR) बबल सॉर्ट को उदाहरण सहित समझाइए।

Explain Bubble sort with example.

बबल सॉर्ट एक सरल सॉर्टिंग एल्गोरिथ्म है जो आसन्न तत्वों की तुलना करके और उन्हें गलत क्रम में होने पर स्वैप करके काम करता है। यह प्रक्रिया तब तक दोहराई जाती है जब तक सूची सॉर्ट न हो जाए।

उदाहरण: ऐरे [5, 1, 4, 2, 8] को आरोही क्रम में सॉर्ट करें।

  1. पास 1: (5,1) → स्वैप → [1,5,4,2,8]; (5,4) → स्वैप → [1,4,5,2,8]; (5,2) → स्वैप → [1,4,2,5,8]; (5,8) → कोई स्वैप नहीं → [1,4,2,5,8]
  2. पास 2: (1,4) → कोई स्वैप नहीं; (4,2) → स्वैप → [1,2,4,5,8]; (4,5) → कोई स्वैप नहीं; (5,8) → कोई स्वैप नहीं
  3. पास 3: (1,2) → कोई स्वैप नहीं; (2,4) → कोई स्वैप नहीं; (4,5) → कोई स्वैप नहीं → सॉर्टेड ऐरे: [1,2,4,5,8]

समय जटिलता: सबसे खराब स्थिति में O(n²)।

29. विभिन्न प्रकार के लूपिंग स्टेटमेंटों का वर्णन कीजिए।

Explain various types of looping statements.

लूपिंग स्टेटमेंट का उपयोग किसी कोड ब्लॉक को बार-बार निष्पादित करने के लिए किया जाता है। मुख्य प्रकार निम्नलिखित हैं:

  1. for लूप: जब पुनरावृत्तियों की संख्या ज्ञात हो।
    for (int i = 0; i < 5; i++) {
        // कोड
    }
  2. while लूप: जब शर्त सत्य होने तक लूप चलता है।
    int i = 0;
    while (i < 5) {
        // कोड
        i++;
    }
  3. do-while लूप: कम से कम एक बार निष्पादित होता है, फिर शर्त जाँची जाती है।
    int i = 0;
    do {
        // कोड
        i++;
    } while (i < 5);

अंतर: for लूप में आरंभीकरण, शर्त और वृद्धि एक पंक्ति में होती है; while लूप में शर्त प्रारंभ में जाँची जाती है; do-while में शर्त अंत में जाँची जाती है।

29. (OR) मल्टीपल इनहेरिटेंस को उदाहरण सहित समझाइए।

Explain multiple inheritance with example.

मल्टीपल इनहेरिटेंस एक ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग अवधारणा है जिसमें एक क्लास एक से अधिक बेस क्लास से गुण और विधियाँ प्राप्त कर सकता है।

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

class Student {
public:
    void study() {
        cout << "Studying..." << endl;
    }
};

class Athlete {
public:
    void play() {
        cout << "Playing..." << endl;
    }
};

class ScholarAthlete : public Student, public Athlete {
public:
    void display() {
        study();
        play();
        cout << "Scholar Athlete" << endl;
    }
};

int main() {
    ScholarAthlete sa;
    sa.display();
    return 0;
}

व्याख्या: ScholarAthlete क्लास Student और Athlete दोनों से इनहेरिट करता है, इसलिए इसमें study() और play() दोनों विधियाँ उपलब्ध हैं।

ध्यान दें: Java में मल्टीपल इनहेरिटेंस क्लास के माध्यम से समर्थित नहीं है, लेकिन इंटरफेस के माध्यम से प्राप्त किया जा सकता है।

30. What is exception? Explain different types of exceptions in PL/SQL.

Exception in PL/SQL is an error condition that occurs during program execution. When an exception is raised, normal execution stops and control is transferred to the exception-handling part of the block.

Types of Exceptions in PL/SQL:

  1. Pre-defined Exceptions – System-defined exceptions like NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE, etc.
  2. User-defined Exceptions – Created by the programmer using the EXCEPTION keyword and raised explicitly using RAISE statement.
  3. Internal Exceptions – System-generated exceptions that are not pre-defined but can be handled using OTHERS handler or by associating with a named exception using PRAGMA EXCEPTION_INIT.

OR

Write the syntax for the following set operators:

(i) INTERSECT

SELECT column1, column2, ...
FROM table1
INTERSECT
SELECT column1, column2, ...
FROM table2;

Explanation: INTERSECT returns only the rows that are common to both SELECT queries.

(ii) EXCEPT

SELECT column1, column2, ...
FROM table1
EXCEPT
SELECT column1, column2, ...
FROM table2;

Explanation: EXCEPT returns rows from the first SELECT query that are not present in the second SELECT query.