Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

**Scribd will begin operating the SlideShare business on December 1, 2020**
As of this date, Scribd will manage your SlideShare account and any content you may have on SlideShare, and Scribd's General Terms of Use and Privacy Policy will apply. If you wish to opt out, please close your SlideShare account. Learn more.

Successfully reported this slideshow.

Like this document? Why not share!

111 views

Published on

data structure questions Answers

No Downloads

Total views

111

On SlideShare

0

From Embeds

0

Number of Embeds

1

Shares

0

Downloads

11

Comments

2

Likes

1

No notes for slide

- 1. Data Structures Questions and AnswersQ What are the different types of parameter passing ?There are two methods of parameter passing –1. Call by value - The parameters that are passed to the function are actualvalues.2. Call by reference - In call by reference the parameters are taken by reference.Pointer variables are taken as parameters.Q List uut and define performance measures of an algorithem.Ans.: The performance of an algorithm can be measured by -1. Time complexity : The amount of time taken by an algorithm to execute, iscalled time complexity2. Space complexity: The amount of space taken required by an algorithm, is calledspace complexity.The time and space complexities are denoted by asymptotic notations. Using thesetwo measures we can decide whether an algorithm is efficient or not.Q What do you mean by the terms average case, best case and worst case timecomplexity?Ans : Average case : The time complexity which we get for certain set of input as aaverage value then it is called the average case time complexity.Best case : The time complexity which we get is very minimum for particularinputs then it is called the best case time complexity.Worst case : The time complexity which we get for certain inputs is maximumthen we call it as the worst case time complexity.Q Give two examplts of non-linear data structures which are widly used.Ans The widely used non-linear data structures are -1. Trees2 GraphsQ What do you mean by linear data structure’?Ans The linear data structure is a kind of data structure in which data is in sequentialmanner. There is no hierarchy followed .Examples of linear data structures are Arrays Linked lists StacksQ. Explain the term dynamic memory.Ans The dynamic memory allocation means one can allocate the memory of requiredsize, as well as de allocate (free) it. So that freed memory can be utilized further.Also the memory can be real1ocated.Q Why the linked representation is preferred ?
- 2. Ans : There are various features of the linked list because of which thelinkedrepresentation is preferred.. They are liste as follows,a) The memory allocation is dynamic. So the developer can allocate as well asde allocate the memory. And so no wastage of memory is there.b) Insertions and deletions of the data is easy.c) Physically the data can be deleted.Q What is the advantage of circular linked list?Ans: In the circular linked list the next pointer of the last node points to the firstnode of the linked list. So one can quickily access the first node when he is accessingthe last node which in turn improves the efficiency of the algorithm as compared tothe singly linked list.

No public clipboards found for this slide

Login to see the comments