Data Structure With C++ 2018 Semester 2 Full Solution Pdf Download Paper CC-3 (IT) 2018

Data Structure With C++ 2018 Semester 2 Full Solution Pdf Download Paper CC-3 (IT) 2018


Answer all the Question

1. Which of the following data structures are indexed structures.

(a) Stack 

(b) Linked list 

(c) Linear array 

(d) None of the above

2. Which are the application(s) of stack..

(a) Function call

(b)  Large number arithmetic's

(c) Evaluation of arithmetic expression

(d) All of the above

3. The logical or mathematical model of a particular organization of data is called.............

(a) Data type

(b) Data structure

(c) Array

(d) Linked list

4. The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree.

(a) 10, 20, 15, 23, 25, 35, 42, 39, 30

(b) 15, 10, 25, 23, 20, 42, 35, 39, 30

(c) 15, 20, 10, 23, 25, 42, 35, 39, 30

(d) 15, 10, 23, 25, 20, 35, 42, 39, 30

5. Which of the following is true about linked list implementation of stack?

(a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.

(b) In push operation, if new nodes are inserted at the end, then in pop operation nodes must be removed from the beginning. 

(c) Both of the above 

(d) None of the above


6. The accessing and processing each record a data structure.

(a) Traversing

(b) Searching

(c) Inserting 

(d) Deleting

7. The data structure which reflects a hierarchical relationship between various elements.

(a) Linked list

(b) Stacks

(c) Tree

(d) Graphs

8. Which of the following is not the member of class?

(a) Static Function

(b) Friend Function

(c) Const Function   

(d) Virtual Function

9. Object oriented programming employs .................. programming approach.

(a) Top-down

(b) Procedural

(c) Bottom-up   

(d) All of these

10. In CPP, c in and c out are the predefined stream....................

(a) Operator

(b) Functions

(c) Objects

(d) Data types


Answer any Four Question

2. What is data structure? Explain any two types of data structure. 

Ans:- A data structure is a way of organizing data that considers not only the objects stored, but also their relation to each other. In other words, the organized collection of data is called data structure. Data Structure = Organized Data + Permitted Operations

A data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently.

Explain Types Of Data Structure

Array Data Structure :- An array is a linear data structure and is a collection of objects stored at contiguous memory locations. The idea is to store multiple items of the same type together in one place. It allows the processing of large amounts of data in a relatively short amount of time. The first element of the array is indexed by a subscript of 0. Various operations like searching, sorting, inserting, traversing, reversing and deleting are possible in an array. 

Stack Data Structure :- Stack is a linear data structure that follows a particular order in which operations are performed. The order is LIFO (Last In First Out). Data entry and retrieval is possible from one end only. The insertion and retrieval of data in the stack are also called push and pop operations. Different operations are possible in the stack like reversing the stack using recursion, sorting, removing the middle element of the stack, etc.

3. What are advantages of linked list over an array ?

Ans :- Dynamic Data Structure: Linked List being a dynamic data structure can shrink and grow at the runtime by deallocating or allocating memory, so there is no need for an initial size in linked list. Whereas an initial size has to be declared in an array, and the number of elements cannot exceed that size.

Whereas an initial size has to be declared in an array, and the number of elements cannot exceed that size.

No Memory Wastage: As the size of a linked list can grow or shrink at runtime, so there is no memory wastage. Only the required memory is allocated. 

In arrays, we have to first initialize it with a size which we may or may not fully use; hence wastage of memory may occur.

Insertion and Deletion Operation: In a Linked List, insertion and deletion operations are quite easy, as there is no need to shift every element after insertion or deletion. Only the address present in the pointers needs to be updated. 

While in an array, we have to shift elements. Suppose we have an array that is sorted, and now we need to insert some element in the array in a sorted way. Let arr[]= [ 1, 3 , 5, 7, ….. ], and we have to insert 2. So, all the elements after 1 have to move by one place towards the right.\

4. What constructors? Explain different types of constructors. 
Ans :- Constructor in C++ is a special method which is automatically invoked at the time of object creation. It is generally used to initialize data members of new objects. A constructor in C++ has the same name as a class or struct. The constructor is called at the time of object creation. It constructs values ​​i.e. provides data to the object so it is known as constructor

Different Types of Constructors
Default Constructor : A constructor without any parameters is called a default constructor. If we do not create constructor the class will automatically call default constructor when an object is created.
Parameter Constructor : A constructor with at least one parameter is called a parametrized constructor.
Copy Constructor : The constructor which creates an object by copying variables from another object is called a copy constructor.
Static Constructor : A static constructor is used to initialize any static data, or to perform a particular action that needs to be performed once only. It is called automatically before the first instance is created or any static members are referenced.

5. What is a graph? Explain adjacency matrix.
Ans :- Graph :- A graph is a non-linear data structure consisting of vertices and edges. Vertices are also sometimes referred to as nodes and edges are lines or arcs that connect any two nodes in a graph. More formally a graph is made up of a set of vertices (V) and a set of edges (E). The graph is denoted by G(E, V).

Avaliable Soon
Hello everyone, I am Abhay Kumar from Jamshedpur. And welcome you to this website. You all can download study related notes, PDF, videos etc. here. I always keep writing some new study related articles on this website. Which is very beneficial for your study.