CBSE Class 12 Computer Science Data Structure Notes Set A

Download CBSE Class 12 Computer Science Data Structure Notes Set A in PDF format. All Revision notes for Class 12 Computer Science have been designed as per the latest syllabus and updated chapters given in your textbook for Computer Science in Class 12. Our teachers have designed these concept notes for the benefit of Class 12 students. You should use these chapter wise notes for revision on daily basis. These study notes can also be used for learning each chapter and its important and difficult topics or revision just before your exams to help you get better scores in upcoming examinations, You can also use Printable notes for Class 12 Computer Science for faster revision of difficult topics and get higher rank. After reading these notes also refer to MCQ questions for Class 12 Computer Science given on studiestoday

Revision Notes for Class 12 Computer Science Data Structure

Class 12 Computer Science students should refer to the following concepts and notes for Data Structure in Class 12. These exam notes for Class 12 Computer Science will be very useful for upcoming class tests and examinations and help you to score good marks

Data Structure Notes Class 12 Computer Science

 

Data Structure

In Computer Science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks.

The data structure can be classified into following two types:

Simple Data Structure: These data structures are normally built from primitive data types like integers, floats, characters. For example arrays and structure. Compound Data Structure:

simple data structures can be combined in various ways to form more complex structure called compound structures. Linked Lists, Stack, Queues and Trees are examples of compound data structure.

Data Structure Arrays

Data structure array is defined as linear sequence of finite number of objects of same type with following set of operation:

· Creating : defining an array of required size

· Insertion: addition of a new data element in the in the array

· Deletion: removal of a data element from the array

class_12_computer_concept_14

In linear search algorithm, if the searched item is the first elements of the array then the loop terminates after the first comparison (best case), if the searched item is the last element of the array then the loop terminates after size time comparison (worst case) and if the searched item is middle element of the array then the loop terminates after size/2 time comparisons (average case). For large size array linear search not an efficient algorithm but it can be used for unsorted array also.

Binary search algorithm
Binary search algorithm is applicable for already sorted array only. In this algorithm, to search for the given item from the sorted array (in ascending order), the item is compared with the middle element of the array. If the middle element is equal to the item then index of the middle element is returned,

otherwise, if item is less than the middle item then the item is present in first half segment of the array (i.e. between 0 to middle-1), so the next iteration will continue for first half only, if the item is larger than the middle element then the item is present in second half of the array (i.e. between middle+1 to size-1), so the next iteration will continue for second half segment of the array only. The same process continues until either the item is found (search successful) or the segment is reduced to the single element and still the item is not found (search unsuccessful).

#include<iostream.h>

int binary_search(int a[ ], int size, int item)

{ int first=0,last=size-1,middle;

while(first<=last)

{

       middle=(first+last)/2;

       if(item==a[middle])

       return middle; // item is found

       else if(item< a[middle])

       last=middle-1; //item is present in left side of the middle element else

       first=middle+1; // item is present in right side of the middle element

}

return -1; //given item is not present in the array, here, -1 indicates unsuccessful search

}

        void main()

{ int b[8]={2,4,5,7,8,9,12,15},size=8;

int item;

cout<<”enter a number to be searched for”;

cin>>item;

int p=binary_search(b, size, item); //search item in the array b

if(p==-1)

     cout<<item<<” is not present in the array”<<endl;

else

     cout<<item <<” is present in the array at index no “<<p;

}

Let us see how this algorithm work for item=12

Initializing first =0 ; last=size-1; where size=8

Iteration 1

CBSE Class 12 Computer Science - Data Structure

      =0, last=7

       middle=(first+last)/2=(0+7)/2=3 // note integer division 3.5 becomes 3

       value of a[middle] i.e. a[3] is 7

       7<12 then first= middle+1 i.e. 3 + 1 =4

iteration 2

CBSE Class 12 Computer Science - Data Structure

       first=4,    last=7

       middle=    (first+last)/2=(4+7)/2=5

       value of a[middle] i.e. a[5] is 9

       9<12 then first=middle+1;5+1=6

iteration 3

CBSE Class 12 Computer Science - Data Structure

       first=6,last=7

       middle=(first+last)/2 = (6+7)/2=6

        value of a[middle] i.e. a[6] is 12 which is equal to the value of item being search i.e.12

As a successful search the function binary_search() will return to the main function with value 6 as index of 12 in the given array. In main function p hold the return index number.

Note that each iteration of the algorithm divides the given array in to two equal segments and the only one segment is compared for the search of the given item in the next iteration. For a given array of size N= 2n elements, maximum n number of iterations are required to make sure whether the given item is present in the given array or not, where as the linear requires maximum 2n number of iteration.

For example, the number of iteration required to search an item in the given array of 1000 elements,

binary search requires maximum 10 (as 1000»210) iterations where as linear search requires maximum 1000 iterations.

Inserting a new element in an array

We can insert a new element in an array in two ways

· If the array is unordered, the new element is inserted at the end of the array

· If the array is sorted then the new element is added at appropriate position without altering the order. To achieve this, all elements greater than the new element are shifted. For example, to add 10 in the given array below:

CBSE Class 12 Computer Science - Data Structure

#include<iostream.h>

void insert(int a[ ], int &n, int item) //n is the number of elements already present in the array

{ int i=n-1;

while (i>=0 && a[i]>item)

        {

        a[i+1]=a[i]; // shift the ith element one position towards right

        i--;

}

a[i+1]=item; //insertion of item at appropriate place

n++; //after insertion, number of elements present in the array is increased by 1

}

void main()

{int a[10]={2,4,5,7,8,11,12,15},n=8;

int i=0;

cout<<“Original array is:\n”;

for(i=0;i<n;i++)

           cout<<a[i]<<”, “;

insert(a,n,10);

cout<<”\nArray after inserting 10 is:\n”;

for(i=0; i<n; i++)

          cout<<a[i]<<”, “;

}

Output is

Original array is:

2,  4,  5,  7,  8,  11,  12,  15

Array after inserting 10 is:

2,  4,  5,  7,  8,  10,  11,  12,  15

Deletion of an item from a sorted array

In this algorithm the item to be deleted from the sorted array is searched and if the item is found in the array then the element is removed and the rest of the elements are shifted one position toward left in the array to keep the ordered array undisturbed. Deletion operation reduces the number of elements present in the array by1. For example, to remove 11 from the given array below:
Following program implement deletion operation for sorted array

CBSE Class 12 Computer Science - Data Structure

#include<iostream.h>

void delete_item(int a[ ], int &n, int item) //n is the number of elements already present in the array

{int i=0;

while(i<n && a[i]<item)

i++;

if (a[i]==item) // given item is found

Please click the link below to download pdf file for CBSE Class 12 Computer Science - Data Structure.

Class 12 Computer Science Notes
CBSE Class 12 Computer Science All Chapters Notes
CBSE Class 12 Computer Science Boolean Algebra Notes Set A
CBSE Class 12 Computer Science Boolean Algebra Notes Set B
CBSE Class 12 Computer Science Boolean Algebra Notes Set C
CBSE Class 12 Computer Science Communication And Computer Networks Notes
CBSE Class 12 Computer Science Communication And Network Notes Set A
CBSE Class 12 Computer Science Communication And Network Notes Set B
CBSE Class 12 Computer Science Computer Networks Notes
CBSE Class 12 Computer Science Data File Handling In C++ Notes
CBSE Class 12 Computer Science Data Structure Notes Set A
CBSE Class 12 Computer Science Data Structure Notes Set B
CBSE Class 12 Computer Science Data Structure Notes Set C
CBSE Class 12 Computer Science Data Structures Notes
CBSE Class 12 Computer Science Data Visualization Using Pyplot Notes
CBSE Class 12 Computer Science Database And SQL Notes Set A
CBSE Class 12 Computer Science Database And SQL Notes Set B
CBSE Class 12 Computer Science Django Notes
CBSE Class 12 Computer Science File Handling Notes
CBSE Class 12 Computer Science Free And Open Source Software Notes
CBSE Class 12 Computer Science Functions In Python Notes
CBSE Class 12 Computer Science Idea of Efficiency Notes
CBSE Class 12 Computer Science Interface Python with an SQL database Notes
CBSE Class 12 Computer Science Introduction To C++ Notes
CBSE Class 12 Computer Science Networking Notes
CBSE Class 12 Computer Science Notes Of Cloud Computing And Open Standards Notes
CBSE Class 12 Computer Science Oops Notes
CBSE Class 12 Computer Science Pointers Notes
CBSE Class 12 Computer Science Practicals Notes
CBSE Class 12 Computer Science Programming In CPP Notes Set A
CBSE Class 12 Computer Science Programming In CPP Notes Set B
CBSE Class 12 Computer Science Programming In CPP Notes Set C
CBSE Class 12 Computer Science Programming In CPP Notes Set D
CBSE Class 12 Computer Science Recursion Notes
CBSE Class 12 Computer Science Revision of The Basics of Python Notes
CBSE Class 12 Computer Science Society Law and Ethics Notes
CBSE Class 12 Computer Science SQL Commands Aggregation Functions Notes
CBSE Class 12 Computer Science Using Python Libraries Notes

CBSE Class 12 Computer Science Data Structure Notes

We hope you liked the above notes for topic Data Structure which has been designed as per the latest syllabus for Class 12 Computer Science released by CBSE. Students of Class 12 should download and practice the above notes for Class 12 Computer Science regularly. All revision notes have been designed for Computer Science by referring to the most important topics which the students should learn to get better marks in examinations. Studiestoday is the best website for Class 12 students to download all latest study material.

Notes for Computer Science CBSE Class 12 Data Structure

Our team of expert teachers have referred to the NCERT book for Class 12 Computer Science to design the Computer Science Class 12 notes. If you read the concepts and revision notes for one chapter daily, students will get higher marks in Class 12 exams this year. Daily revision of Computer Science course notes and related study material will help you to have a better understanding of all concepts and also clear all your doubts. You can download all Revision notes for Class 12 Computer Science also from www.studiestoday.com absolutely free of cost in Pdf format. After reading the notes which have been developed as per the latest books also refer to the NCERT solutions for Class 12 Computer Science provided by our teachers

Data Structure Notes for Computer Science CBSE Class 12

All revision class notes given above for Class 12 Computer Science have been developed as per the latest curriculum and books issued for the current academic year. The students of Class 12 can rest assured that the best teachers have designed the notes of Computer Science so that you are able to revise the entire syllabus if you download and read them carefully. We have also provided a lot of MCQ questions for Class 12 Computer Science in the notes so that you can learn the concepts and also solve questions relating to the topics. All study material for Class 12 Computer Science students have been given on studiestoday.

Data Structure CBSE Class 12 Computer Science Notes

Regular notes reading helps to build a more comprehensive understanding of Data Structure concepts. notes play a crucial role in understanding Data Structure in CBSE Class 12. Students can download all the notes, worksheets, assignments, and practice papers of the same chapter in Class 12 Computer Science in Pdf format. You can print them or read them online on your computer or mobile.

Notes for CBSE Computer Science Class 12 Data Structure

CBSE Class 12 Computer Science latest books have been used for writing the above notes. If you have exams then you should revise all concepts relating to Data Structure by taking out a print and keeping them with you. We have also provided a lot of Worksheets for Class 12 Computer Science which you can use to further make yourself stronger in Computer Science

Where can I download latest CBSE Class 12 Computer Science Data Structure notes

You can download notes for Class 12 Computer Science Data Structure for latest academic session from StudiesToday.com

Can I download the Notes for Data Structure Class 12 Computer Science in Pdf format

Yes, you can click on the link above and download notes PDFs for Class 12 Computer Science Data Structure which you can use for daily revision

Are the revision notes available for Data Structure Class 12 Computer Science for the latest CBSE academic session

Yes, the notes issued for Class 12 Computer Science Data Structure have been made available here for latest CBSE session

How can I download the Data Structure Class 12 Computer Science Notes pdf

You can easily access the link above and download the Class 12 Notes for Computer Science Data Structure for each topic in Pdf

Is there any charge for the Class 12 Computer Science Data Structure notes

There is no charge for the notes for CBSE Class 12 Computer Science Data Structure, you can download everything free of charge

Which is the best online platform to find notes for Data Structure Class 12 Computer Science

www.studiestoday.com is the best website from which you can download latest notes for Data Structure Computer Science Class 12

Where can I find topic-wise notes for Class 12 Computer Science Data Structure

Come to StudiesToday.com to get best quality topic wise notes for Class 12 Computer Science Data Structure

Can I get latest Data Structure Class 12 Computer Science revision notes as per CBSE syllabus

We have provided all notes for each topic of Class 12 Computer Science Data Structure as per latest CBSE syllabus