Here is class 12 computer science Unit 9 [Type A] solutions for Sumita Arora back exercise assignment. Below includes both textual and video solutions wherever required. View all the answers in assignment for chapter 9 and for all chapters here.Watch all video tutorials for chapter 9: Data Structures – 1 Linear Lists.
Data is the most fundamental element in the processing segment of the computer. Data Structure deals with the arrangement and organization of the data in the memory so that better storage with minimum memory size can be achieved.
Some common structure are :-1. Simple Data Structure (Array, Linear List)2. Compound Data Structure (Link list, Queue, Stack)
Data type defines as the set of value along with well-defined operations on these to values. Such as float, integer and multiplication as operation on that.
Data Structure is the physical implementation that clearly defines the manipulation, storage, accessing and many more. Such as stack, queue and insertion, deletion are the operation on these.
Linear data structure are the single level implementation of non-linear data structure. In this all the element from a sequence.Example Stack, queue, Link list.
Non-linear data structure are the multi level implementation of non-linear data structure. In this no type of sequence in formed. Example Tree, Graph.
Some Linear Data structure are :-1. Stack2. Queue etc.
Yes, link list is a linear data structure as in this all the elements are arranged in linear locations of memory and same level of arrangement.
Stack works on the principle of LIFO i.e. last in first out. In this insertion and deletion happens to be on same side refers as top.
Queue works on the principle of FIFO i.e. first in first out. In this insertion rear end and deletion on front end that is opposite side to each other.
Linear data structure are the single level implementation of non-linear data structure. In this all the element from a sequence. In this linear memory location is applied on data storage.Example Stack, queue, Link list.
Some operations on linear lists are:1. Insertion2. Traversing3. Deletion4. Updating5. Sorting etc.
(i) Linear lists :- Storage of unique id of employee of a company.(ii) queue :- CPU scheduling, Disk Scheduling, appointment list i.e. FIFO implementation.
List comprehensions are used for creating new lists. As list comprehensions returns lists, they consist of brackets containing the expression, which is executed for each element along with the for loop to iterate over each element.
It is useful to extract information from an existing list through iteration. Example [i*2 for in range(10)]
Some advantages of list comprehensions :-Code Reduction : In this code of more than 3 line can be reduced into single line.Faster code processing : In this code execution is faster than loop and map function.
List comprehensions should always be used when there is need to reduce the code size, increase readability and to enhance performance. List comprehensions should always be avoided when there are multiple cases and structure of code is complex.
Nested list is the case when a main list having several lists as constituents of main list.
L1 = [1, 2, 3, [11, 12, 13], 7, , [15,14], 10]
In above case [11, 12, 13], [15,14] is forming nesting of list to L1.
A two dimension list is in which each element is another list and it forms a table like configuration which having rows and columns.example L1 = [[12, 34, 43], [1, 2, 3], [4, 5, 6]]
All the two dimension list is a nested list as it satisfy condition of nesting.
A two dimension list can be used to implement marks of student in various terms
Abhinav = [[95, 90, 87, 76, 90],
[60, 96, 92, 93, 90],
[78, 67, 87, 88, 80],
[45, 95, 90, 89, 88]]
A ragged list is irregular 2D list where each nested list of different shape while a two-dimensional list having same shape of nested loop.
ragged_list = [[95, 90, 87], [60, 96, 92], [78, 67, 87]]
2D_list = [[95, 90, 87], [60, 92], ]
Ragged list can be used to store list of students in different classes.
List are stored in the sample manner as the string stores. Not like string each character but each element of list is given a specific location to access.
But in case of the 2D list as each element of list may be variable in size hence a reference is given to each element unlikely that of list.
List 3 will have two elements in which first will be reference to location of List 1 and second will be at List 2.
Clear Doubts with Computer TutorIn case you’re facing problems in understanding concepts, writing programs, solving questions, want to learn fun facts | tips | tricks or absolutely anything around computer science, feel free to join CTs learner-teacher community: students.computertutor.in
You cannot copy content of this page