Save as PDF

Opens your browser print dialog — select "Save as PDF" to download.

NO. of Questions: 8 [Total No. of Printed Pages: 3
Roll No .................

MCA-101

M.C.A. I Semester (Two Year Course)

Examination, December 2024

Programming in C with Data Structure

Time: Three Hours Maximum Marks: 70

Note: i) Attempt any five questions.

किसी पाँच प्रश्नों को हल कीजिए।

ii) All questions carry equal marks.

सभी प्रश्नों के समान अंक हैं।

iii) In case of any doubt or dispute the English version question should be treated as final.

किसी भी प्रकार के संदेह अथवा विवाद की स्थिति में अंग्रेजी भाषा के प्रश्न को अंतिम माना जायेगा।

1.

a) Write recursive and non recursive program to calculate factorial of a number.

किसी संख्या के फेक्टोरियल की गणना करने के लिए Recursive और Non Recursive प्रोग्राम लिखें।

b) Write a program to send values using call-by-value method and call by reference method and also compare both methods.

Call by value और Call by reference उपयोग करके Value भेजने के लिए एक प्रोग्राम लिखें और दोनों विधियों की तुलना भी करें।

2.

a) List and brief the uses of Dynamic Memory Allocation Functions. Write a C program to allocate a block of memory using malloc().

डायनेमिक मेमोरी एलोकेशन फंक्शंस के उपयोगों की सूची बनाइए और उन्हें संक्षिप्त करें। Malloc() का उपयोग करके मेमोरी के एक ब्लॉक को आवंटित करने के लिए एक C प्रोग्राम लिखें।

b) Write a C program to create mark sheet for students using self referential structure.

Self referential संरचना का उपयोग करके छात्रों के लिए मार्कशीट बनाने के लिए एक C प्रोग्राम लिखें।

3.

a) What are enqueue and dequeue operations?

एनक्यू और डीक्यू ऑपरेशन क्या हैं?

b) Write a program to PUSH and POP operation of STACK. STACK के PUSH और POP ऑपरेशन के लिए एक प्रोग्राम लिखें।

4.

a) What are the time and space complexity of the following code:

निम्नलिखित कोड की समय और स्थान जटिलता क्या है:

int a = 0;
for (i = 0; i < N; i++) {
for (j = N; j > i; j--) {
a = a + i + j;
}
}

b) Explain Asymptotic Notations with example.

Asymptotic नोटेशन को उदाहरण सहित समझाइए।

5.

a) Explain the steps involved in insertion and deletion into a doubly linked list.

Doubly linked की सूची में Insertion और Deletion में शामिल Steps की व्याख्या करें।

b) Discuss advantage and disadvantage of linked list over Array.

ऐरे की तुलना में लिंक्ड सूची के लाभ और हानि पर चर्चा करें।

6.

What is the time complexity of Linked List operations? Why does the linked list delete and insert operation have the complexity of O(1)? Justify your answer with example.

लिंक्ड सूची संचालन की समय जटिलता क्या है? लिंक की गई सूची डिलीट और इंसर्ट ऑपरेशन में O(1) की जटिलता क्यों है? उदाहरण के साथ अपने उत्तर की पुष्टि करें।

7.

a) Construct an expression tree for the expression (a + b * c) + ((d + e * f) + g). Give the outputs when you apply preorder, inorder and postorder traversals.

Expression (a + b * c) + ((d + e * f) + g) के लिए एक Expression tree का निर्माण करें। जब आप प्रीऑर्डर, इनऑर्डर और पोस्टऑर्डर ट्रेवर्सल लागू करते हैं तो आउटपुट दें।

b) Write the advantages of threaded binary tree.

थ्रेडेड बाइनरी ट्री के लाभ लिखिए।

8.

Define height balanced Binary tree. Write a program to check if a tree is height-balanced and also calculate the time and space complexity of binary tree.

Height balanced बाइनरी ट्री को परिभाषित करें। यह जांचने के लिए एक प्रोग्राम लिखें कि कोई ट्री height balanced है या नहीं और बाइनरी ट्री की समय और स्थान जटिलता की गणना भी करें।