0% found this document useful (0 votes)
28 views6 pages

UNIT 1 - 2 Marks

Data structures two marks

Uploaded by

alphaashwin1526
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
28 views6 pages

UNIT 1 - 2 Marks

Data structures two marks

Uploaded by

alphaashwin1526
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
one) (2 Narks) Al INNA UNIVERSITY PART A QUESTIONS 1, When arrays are better than linked list? Give an example. (Nov/ Dec 2021) e Access Time: Random Access Memory is allowed in arrays. It means it takes O(1) to access any element in the array. In linked list, Random access is not allowed. We have to access elements sequentially starting from the first node. Linked list takes O(n) for access to an element in the list in the worst case. . Another advantage of arrays in access time is special locality in memory. Arrays are defined as contiguous blocks of memory, and so any element will be physically near its neighbours. This greatly benefits from modern CPU caching methods. ¢ Extra memory space for a pointer is required with each element of the list. Hence linked lists wastes memory in terms of extra reference points. 2, What is the benefit of circularly linked list over singly linked list in search applications? (Nov/ Dec 2021) 1. In Circular Linked List, end node will point to the first node. It saves time to go to the first node from the last It can be done in single step because there is no node. .s. Whereas in singly need to traverse the in between nodes linked list it won’t point to first node. . Circular list is very useful in case of Game play, to give turns for each player without any failure (due to its circular connectivity). 3, Circular Linked list starting at any position. er & scanned with OKEN Scanner Nn ) B Data Structures 3. Define Linked List? (Nov/Dec 2019) Linked list is a collection of data elements stored in series of nodes, Each node consists of data and a pointer to the next node. The nodes are not necessarily adjacent in memory. 4, Define an Abstract Data Type? (AU Nov/Dec 2019, May/June 2016, April/May 2015, Nov/Dec 2015, 2013, 2012 & 2010, May/June 2010, Nov/Dec 2009) An Abstract Data Type (ADT) is a mathematical model for data type, which gives a:set of operations available to the user but never states the details of its implementation. Objects. such .as:.list,.-stack, queue and graphs along with their operations can be'viewed.as.ADTs. 5. Illustrate the differences between linear lined list and circular linked list: : (AU Apr/May 2019) S.No Linear linked list Circular linked list 1 The last node contains a | The last node contains a ‘null pointer boda pointer to the first node of : the list. 2. | The beginning ofthe list | The circular linked list has contains the head.node. | no beginning and no end. 6. What are the advantages of linked list over arrays? (AU Apr/May 2019, May/June 2013) © Itis not necessary to specify the number of elements in a linked list during its declaration. © Ttcan grow and shrink in size depending upon the insertion and deletion that occurs in the list. * It does not waste memory space, 34 & scanned with OKEN Scanner —$$___ Lists « Insertions and deletions at any place in a list'can be ‘handled easily and efficiently. 7, What is the disadvantage of linked list over array? (Nov/Dec 2018, Apr/May 2017, Jan 2016, May/June 2013) Random access is not allowed: So: we have to access clements sequentially starting from the first node: Extra memory space for a pointer is required with can each element of the list, I 3. Arrays have better cache locality that c can make a a a pretty big difference in performatice, 8. What is circular linked list? (AU, May/June 2016) Circular linked list a linked list in which the ‘last’ node of the list points to the first node of the list,’ There:are two: types’ of eirular linked list. nub isle isder 1. Singly circular linked list 2. Doubly circular linked list’'’ 9, Define linear and non-linear data structures. Give an example for each. : (AU Nov/Dec 2013) Linear Data Structures In linear data structures, values'aré’ artanged i in’ linéar: or Sequential otder:/ Arrays! linked Tists, stacks and uci ‘are'exat data structures in which Valles! Non-Linear Data Structures. This type is opposite to linear. The data values in this structure are not arranged in order, Tree, graph, table and sets are ane ofnon ~ linear data structures: ); vc vio 1 hull « 1 Sle 35 & scanned with OKEN Scanner yr B Data Structures performed in set ADT? 10. What are the operations - (AU May/June 2012) - Union, Intersection, complement. 11. Write any three applications of linked list. (May/June 2012) 1, Linked list can be used for representing a polynomia| expressions and manipulations 2. Radix Sort 3. Multi lists. 12. Define singly linked list compare with an array. (May/June 2010) Linked List Size of list is unfixed Tt is not necessary to specify the number of elements during declaration. r Array Size of an array is fixed Tt is necessary to specify the number of elements during declaration. Insertions and deletions are Insertions and deletions are difficult. easy. It occupies more memory. It occupies less memory. 16. State the advantage of ADT? e ADTs are easier to understand. Implementations of ADTS can be changes without requiring changes to the program that uses the ADTs. e ADTs can be easy to reuse and debug. 17. Define Data Structure. am ; . oe is a way of sorting, organizing and retrieving in a computer so that it can be used efficiently. gi 36 * & scanned with OKEN Scanner 18 pefine linked list, = : Linked list is a collecti tion of data clements stored in series of nodes. Each node consis to the r Sists of data and a pointer to t! t cl nex! node. The are no} 'y adjacer no odes are not necessaril: adjacent in memory. 19 what is the importance of header nodes? leader of the linked list is the first element i i i the number of elements in the list, Using Reader ot ae starting address of the linked list, ee 20. pen why binary search cannot be performed on a linked ist. Binary search can be done only on a sorted list and also the list needs to be accessed in the middle at the random position. The limitation oflinked list is that, random access is not allowed. We have to access elements in sequence starting from the first node. So we cannot do binary search with linked lists. 21. Define singly linked list. Singly linked list is a list, in which each node contains element and er to the next node. The singly linked list can traverse in only point one direction. 22, Define doubly linked list. What are the operations that can it? State its advantages. be performed on i in which each node has three fields. backward link (BLINK) and data list is it allows traversing and successor nodes are Doubly linked list is a linked list That is forward link (FLINK), field. The advantage of using doubly link to both directions. Finding predecessor easier. Pinar WA) & scanned with OKEN Scanner Le Data Structures The operations performed in doubly linked list are, insert, deletion, traversals, find operations. ae my 23. Define circularly linked list. What are its advantages? Circular linked list is a linked list, in which the last node of the lig points to first node of the list. The main advantage is it allows hig, access to the first and last node. It allows list starting at any position 24. List out the disadvantages of using a linked list © Searching a particular element in a list is difficult and time consuming ¢ A linked list will use more storage space than an array to stor the same number of elements ANNA UNIVERSITY PART B AND C QUESTIONS 1. Consider the following problem scenario: In recording scores for a golf tournament, we enter the name and score of the player as the player finishes. This information is to be retrieved in each of the following ways. Scores and names can be printed in order by ascending or by descending scores. Given the name ofa player. other players with the same score can be printed. © Give procedure by using the doubly linked list data structure, for implementing a solution for the problem. (AU Nov/Dec 2021) 2. Write procedure or pseudo codes for the following operations 0" circular linked lists: (i) insertion (ii) deletion (iii) count (AU Nov/Dec 202)) —— ee 38 & scanned with OKEN Scanner

You might also like