Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
32 views
26 pages
Dsa Merged
JSS DSA file
Uploaded by
meritation99
AI-enhanced title
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
Download
Save
Save dsa_merged For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
32 views
26 pages
Dsa Merged
JSS DSA file
Uploaded by
meritation99
AI-enhanced title
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
Carousel Previous
Carousel Next
Download
Save
Save dsa_merged For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save dsa_merged For Later
You are on page 1
/ 26
Search
Fullscreen
JSS MAHAVIDYAPEETHA LABORATORY MANUAL Subject Name: Data Structure Lab Subject Code: BCS 351 COURSE: B.Tech. SEMESTER: IIT. SEM. Name Roll No. Section-Batch Department of Computer Science and Engineering JSS ACADEMY OF TECHNICAL EDUCATION C-20/1, SECTOR-62, NOIDAJSS Academy of Technical Education— NOIDA Department of Computer Science and Engineering VISION OF THE INSTITUTE ISS Academy of Technical Education, Noida aims to become an Institution of excellence in imparting quality Outcome Based Education that empowers the young generation with Knowledge, Skills, Research, Aptitude and Ethical values to solve Contemporary Challenging Problems. MISSION OF THE INSTITUTE ‘© Develop a platform for achieving globally acceptable level of intellectual acumen and technological competence. ‘© Create an inspiring anibience'that raises the motivation level for conducting quality research, * Provide an environment for acquiring ethical values and positive attitude. VISION OF THE DEPARTMENT To spark the imagination of the Computer Science Engineers with values, skills and éreativity to solve the real world problems. MISSION OF THE DEPARTMENT ‘+ Tojinculeate creative thinking and problenrsolving skills through effective teaching, learning and research. ‘+ To empower professionals with core competency in the field of Computer Science and Engineering. ‘© To foster independent and lifelong learning with ethical and social responsibilities. PROGRAM EDUCATIONAL OUTCOMES (PEOs) PEO1: To apply computational skills necessary to analyze, formulate and solve engineering problems. PEO2: To establish as entrepreneurs, and work in interdiseiplinary research and development organizations as an individual or in a team. PEOS: To inculcate ethical values and leadership qualities in students to have a successful career. PEO4: To develop analytical thinking that helps them to comprehend and solve real-world problems and inherit the attitude of lifelong learning for pursuing higher education. Data Structure Lab (BCS 351) Manual (CS, III Sem) Page |2JSS Academy of Technical Education— NOIDA. Department of Computer Science and Engineering PROGRAM OUTCOMES (POs) Engineering Graduates will be able to: Engineering knowledge: Apply the knowledge of mathematic: nce, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems. Problem analysis: Identify, formulate, review research literature, and analyze complex engineering problems reaching'substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences. Design/development of solutions: Design"solitions for complex: engineeting problems and design system componénis or” processes “that-meet the specified needs with appropriate consideration for the public health and safety, and thé cultural, societal, and environmental considerations. Conduct inyestigations of complex problems: Use research-based knowledge and research methods inéhiding design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering and IT tools inéluding prediction and modeling 6 coniplex engineering activities with an understanding of the limitations. ‘The engineer and society: Apply-reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering practice. Environment and sustainability: Understand the-impact of the professional engineering solutions in societal'and environmental contexts, and demonstrate the knowledge of, and need for sustainable development: Ethies: Apply ethical principles and commit to”professional ethics and responsibilities and norms of the engineering practice. Individual and team work: Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings. Communication: Communicate effectively on complex engineering activities with the engineering community and with society at large, such as, being able to comprehend and Data Structure Lab (BCS 351) Manual (CS, III Sem) Page [3JSS Academy of Technical Education— NOIDA. Department of Computer Science and Engineering write effective reports and design documentation, make effective presentations, and give and receive clear instructions. Project management and finance: Demonstrate knowledge and understanding of the engineering and management principles and apply these to one’s own work, as a member and leader in a team, to manage projects and in multidisciplinary environments. Life-long learning: Recognize the need for, and have the preparation and ability to engage in independent and life-long learning in the broadest context of technological change. Data Structure Lab (BCS 351) Manual (CS, III Sem) Page |4JSS Academy of Technical Education— NOIDA. Department of Computer Science and Engineering PROGRAM SPECIFIC OUTCOMES (PSOs) PSO1: Acquiring in-depth knowledge of theoretical foundations and issues in Computer Science to induce learning abilities for developing computational skills. PSO2: Ability to analyse, design, develop, test and manage complex software system and applications using advanced tools and techniques. Data Structure Lab (BCS 351) Manual ( Page |5JSS Academy of Technical Education— NOIDA Department of Computer Science and Engineering COURSE OUTCOMES (COs) ‘Students be capable to identity the appropriate data structure for given problem 209.1 ‘Students will be able to understand various data structure such as stacks, queues, trees, igraphs, cte. to solve various computing problems €209.2 ‘Students will be able to implement various kinds of searching and sorting techniques, and €209.3 now when to choose which techniques. Students will be able to learn implementation different operations on BST. 209.4 CO-PO MAPPING POI | PO2] PO3 | PO4 | POS | POG | PO7| POS | POY | POI0 | POIT | POI2 Fr a 1 0 2 €209.1 | Da) | eee lead, Oe | T T 0 z €209.2 { 2 sa 3 | 26) sto | Oa ela T 0 2 209.3 7 b=] aay |? | 2 | hl OL T 0 a €209.4 | 2.25 | 275 | 2.75 | 1.75 | 3.00 | 0.00] 0.00 [1.00 [00 [1.00 | 0.00] 2.00 C209 CO-PSO MAPPING: PSO1| PSO2 2 2 209.2 2 2 C2093, 2 2 209.4 2.00 | 2.00 209 Data Structure Lab (BCS 351) Manual (CS, III Sem) Page | 6Program 1: Write a Program to implement Bubble Sort. include
using namespace std; void bubbleSort(int arr{], int n) { for(inti=O;1
arth +14 swap(arri)}, arti + 1D; swapped = true;} if (swapped) break:} ) void printArray(int arr(), int m){ for(int i= 0;1-<1n; 144) cout << arti} <<" cout << endl; , int maing){ int arr{)= (184, 134, 225, 212,322, 311, 390}; int n= sizeoffar)/ sizeof(arr[0); cout << "Original array: printArray(arr, n); bubbleSort(arr, n}; cout << "Sorted array printArray(arr, n); return 0; OUTPUT: Original array: 164 134 225 212322 311 390 Sorted array: 134 164 212 225 311 322 390Program 2 : Write a Program to implement Selection Sort. include
using namespace std; void selectionSortint are), int n){ for(int i= 0:5
using namespace std; void insertionSort(int arr(}, int n){ for(int while (j >= 0 && arr{j]> key) { arr{j +11 aril; is » arr) +1]= key; int main0{ int are{]= (164, 134, 225, 212,322, 311, 390); int n= sizeof{art) / sizeot{arr[o)); InsertionSort(arr, n)s return 0;OUTPUT: Original array: 164 134 225 212.922 311.390 Sorted array: 134 164 212 225 311 322390 Program 7: Write a Program to implement Linear Search. #include
using namespace std; int linearSearch(int arr(], int n, int target) { for (int i= 051 <5 i+#){ if (arrfi] == target) return i; y return 1; ) int main0{ int are[] = (164, 134, 225, 212,322, 311, 390}; Int n= sizeot{art) / sizeot{arr[o)); Int target =212; int result = tinearSearch(arr, n, target); if (result cout << "Found at index: "<< result << endl; else cout << "Not found” << endl; return 0;OUTPUT: Found at index: 3 Program 8: Write a Program to implement Binary Search. include
using namespace std; int binarySearch(int art[}, int n, int target) { int toft sright=n 15 while (left <= right) { Int mid = left + (right - Left) /2; if (arr{midy carget) return mid; else if (arrimid]
> target; int result = binarySearch(arr, n, target); if (result !=-1) cout << "Found at index: "<< result << endl; alse cout << "Not found” << endl; return 0; ) ouTPUT: Enter number to search: 34 Found at index: 4 Program 11: Write a Program to implement Stack using Array. finclude
using namespace std; class Stack { private: int* arr; int top; int capacity; public: Stack{int size) { capacit; arr = new int{eap: top =-1; // Stacks i y Stack) ( dotete(] arr; » void push(int x){ if (top = sapacity -1){cout << "Stack Overflow" << endl; return; , arr[++top] = x; pushed to stack” << endl; int pop(){ if (top == -1){ ‘cout << "Stack Underflow" << endl; returnt; return arr[top—}; } int peek(){ if (top == -1) ‘cout << "Stack is Empty" << endl; return -4; // Indicating that the stack is empty , return arr[toph; d bool isEmpty) { return top. y bool isFulld { return top == capacity - 1; int main0){ Stack stack(5); // Stack of size stack push(10}; stack.push(20); stack.push(30); stack.push(40); stack.push(50};cout << "Top element is "<< stack.peok() << endl; ‘cout << stack.pop() <<" popped from stack” << endl; cout << "Top element is " << stack.peek() << endl; stack.push(60}; cout <<"Top element << stack.peek() << endl; return 0; OUTPUT: 10 pushed to stack 20 pushed to stack 30 pushed to stack 40 pushed to stack 50 pushed to stack Top element is 50 50 popped from stack Top element is 40 60 pushed to stack Top element is 60 Program 12: Write a Program to implement Queue using Array. #inctude
using namespace std; class Queue{ private: int* arr; int front; int rear; int capacity: public: Queuotint size) { capacity = size; arr = new int{capacity; fronty ~Queuel){ detetef] arr; y void enqueuetint x){ if (rea sapacity « 1) { ‘cout << "Queue Overflow" << endl; return; arr[++rear] =x; cout << x <<" enqueued to queue" << en y int dequeue(){ if (front -1 [I front > rear){ ‘cout << "Queue Underflow" << endl; return -1; » return arr[front++]; 1 [| front > rear) { ‘cout << "Queue is Empty" << endl; return -1; ) return arr{tronty; ? boot isEmpty) { return front 1] front > rear; y boot isFulld { return ret sapacity - 1;int main0{ Queue q(4); q.enqueue(10}; q.enqueue(20}; qeenqueue(3 q-enqueue(4o); ‘cout << "Front element is "<< q.peek() << endl; cout << q.dequeue() <<" dequeued from queue" << endl; cout << "Front element is "<< q.pesk() << endl; q.enqueue(60}; ‘cout << "Front element is "<< q.peek() << endl; return 0; ) output: 10 enqueued to queue 20 enqueued to queue 30 enqueued to queue 40 enqueued to queue Front element is 10 10 dequeued from queue Front element is 20 60 enqueued to queue Front element is 20 Program 13: Write a Program to implement Circular Queue using Array. include
using namespace std; class CircularQueue { private: int* arts int front;int rear; int capacity; public: CircularQueue(int size) { capacity = size; arr = new int[capacity}; ~CircularQueue() { detete[] arr} boot isFull){ return (rear + 1) % capacity: y boot isEmpty(){ return front y void enqueuetint x){ if (isFulUQ){ cout << "Queue Overflow" << endl return; , it front ==-1){ front = 0;) rear= (rear +1) % capacity; arr{rear] cout <
using namespace std; class Node { public: int date; Node* next; class Stack ( private: Node* top; public: Stack) { top =nullptr; y Stack!) { while (top != nulipte) { Node* temp = top; top = top->next; dotete temp; y void pusi 1) { Node* newNode = new Node(}; newNode->dat newNode->next ‘top = newNode; cout << x<<" pushed to stack" << endl; y int pop { if (top == nullpte){ cout << "Stack Underflow" << endl; return -1; , int value = top->data; Node* temp = top;top = top->next; delete temp; return value; y int peek(){ if (top == nullptr) { ‘cout << "Stack is Empty” << endl; return -1; , return top>data; y bool isEmpty) { return top ullptr; Fi int main0{ Stack stack; stack.push(10); stack.push(20); stack.push(30}; cout << "Top element is "<< stack.peek{) << endl; ‘cout << stack.pop() <<" popped from stack" << endl; cout << "Top element is "<< stack.p: 3k) << endl; stack.push(60); ‘cout << "Top element is" return 0; ) OUTPUT: 10 pushed to stack 20 pushed to stack 30 pushed to stack Top element is 30 30 popped from stack Top element is 20 60 pushed to stackTop element is 60 Program 15: Write a Program to implement Queue using LinkedList. #include
using namespace std; class Node { public: int data; Node* next; class Queue{ private: Node* front; Node* rear; public: Queuet){ front = nullptr; rear=nullptr;) while (front != nultptr) { Node* temp = front; front = front >next; delete temp:}) void enqueuetint x) { Node* newNode = new Node(); newNode->dat newNode->next = nullptr; it (res == nullptr){ front = rear = newNode; pelse{ rear>next = newNode; rear= newNode;} cout << x<<" enqueued to queue" << endl;y int dequeue) { if (front == nuliptr) { ‘cout << "Queue Underflow" << endl; return 13} int value = front->data; Node* tem; ront; front = front>next; nullptr){ rear=nullptr;} delete temp; return value;) int peek(){ if (front nullptr){ ‘cout << "Queue is Empty" << endl; return 4; return front>d y boot isEmpty0){ return front nullpte Int maing Queue qi; enqueue(30); q-enqueue(40o}; q.enqueue(50}; ‘cout << "Front element is " << q.peek() << endl; cout << .dequeue() << lequeued trom queue" << endl; ‘cout << "Front element is "<< q.peek() << endl; q.enqueue(60}; cout << "Front element is "<< q.peok() << endl; return 0; ) OUTPUT:30 enqueued to queue 40 enqueued to queue 50 enqueued to queue Front element is 10 10 dequeued from queue Front element is 20 60 enqueued to queue Front element is 20 Program 16: Write a Program to implement Circular Queue using LinkedList. #inelude
using namespace std; class Node { public: int data; Node* next; class CircularQueue { private: Node* front; Node* rear; public: CircutarQueue() { front = nullptr: ullptrs » ~CircularQueue(){ white (fro nultptr) { Node* temp = front; front = front >next; delete temp; y bool isEmpty(){return front == nullptr; y void enqueuetint x){ Node* newNode = new Node(); newNode->d hewNode->next = nullptr; if (isEmpty) { front = rear = newNode; rear>next =front; // Making it circular pelset rearone = newNode; rear = newNode; rearonext ont; } cout << x <<" enquoued to queue" << en y int dequeue) { isEmpty) ( cout << "Queue Underflow" << endl; return -1; » int value = front >data; if (front == rear){ delete front; front = rear = nullpte; pelse{ Node* temp = front; front = front->next; rear next = front; delete temp; » return value; y int peek(){ if (isEmpty) { ‘cout << "Queue is Empty" << endl;return -4 int maing){ CircularQueue q; aeenqueue(10}; a.enqueue(20}; a.enqueue(30); a.enqueue(40); q.enqueue(50}; ‘cout << "Front element is "<< q.pook() << endl; cout << q.dequeue() <<" dequeued from queue" << endl; cout << "Front element is " << q.peek() << endl; q-enqueue(60}; ‘cout << "Front element is "<< q.peok() << endl; return 0; ) OUTPUT: 10 enqueued to queue 20 enqueued to queue 30 enqueued to queue 40 enqueued to queue 50 enqueued to queue Front element is 10 10 dequeued from queue Front element is 20 60 enqueued toqueue Front element is 20
You might also like
Laboratory Manual: Subject Name: Data Structure Lab Subject Code: BCS 351
PDF
No ratings yet
Laboratory Manual: Subject Name: Data Structure Lab Subject Code: BCS 351
84 pages
DS - Lab (KCS-351) Manual
PDF
No ratings yet
DS - Lab (KCS-351) Manual
65 pages
Ds Lab Manual-IoT Final
PDF
No ratings yet
Ds Lab Manual-IoT Final
78 pages
Vision of The Institute: 4. To Inculcate Professional Behavior, Positive Attitude, and Communication Skills
PDF
No ratings yet
Vision of The Institute: 4. To Inculcate Professional Behavior, Positive Attitude, and Communication Skills
8 pages
BCSL305 DS LAB Manual Updated
PDF
No ratings yet
BCSL305 DS LAB Manual Updated
59 pages
Ds Adip
PDF
No ratings yet
Ds Adip
43 pages
DSa Com Vivek
PDF
No ratings yet
DSa Com Vivek
28 pages
S Lab Record
PDF
No ratings yet
S Lab Record
40 pages
Labmanual: Bcse2321: Data Structures Using C++ Lab Manual
PDF
No ratings yet
Labmanual: Bcse2321: Data Structures Using C++ Lab Manual
60 pages
DS Lab Manual CSE - Updated
PDF
No ratings yet
DS Lab Manual CSE - Updated
61 pages
R Programming
PDF
No ratings yet
R Programming
6 pages
Data Structures Lab Manual 2021-22
PDF
No ratings yet
Data Structures Lab Manual 2021-22
98 pages
DSA Lab Manual 2024-2025 Updated
PDF
No ratings yet
DSA Lab Manual 2024-2025 Updated
86 pages
Aiml Ds Lab Manual - 2024 25
PDF
No ratings yet
Aiml Ds Lab Manual - 2024 25
61 pages
DSA Lab Manual
PDF
No ratings yet
DSA Lab Manual
150 pages
18CSC201J DS
PDF
No ratings yet
18CSC201J DS
86 pages
LDS Lab Manual
PDF
No ratings yet
LDS Lab Manual
63 pages
Question Bank For Ds
PDF
No ratings yet
Question Bank For Ds
32 pages
CS3301 Data Structures
PDF
No ratings yet
CS3301 Data Structures
41 pages
DS Lab Manual
PDF
No ratings yet
DS Lab Manual
151 pages
(An Iso 9001-2008 Certified Institution) (Approved by AICTE, New Delhi & Affiliated To Anna University)
PDF
No ratings yet
(An Iso 9001-2008 Certified Institution) (Approved by AICTE, New Delhi & Affiliated To Anna University)
128 pages
Lab Manual FEB 9
PDF
No ratings yet
Lab Manual FEB 9
67 pages
DocScanner Oct 5, 2023 4-14 PM
PDF
No ratings yet
DocScanner Oct 5, 2023 4-14 PM
56 pages
Muffakham Jah College OF Engineering and Technology
PDF
No ratings yet
Muffakham Jah College OF Engineering and Technology
78 pages
DS Lab Manual
PDF
No ratings yet
DS Lab Manual
55 pages
DS Lab Manual
PDF
No ratings yet
DS Lab Manual
62 pages
DSA Lab Manual
PDF
No ratings yet
DSA Lab Manual
146 pages
Data Structures Lab Manual
PDF
No ratings yet
Data Structures Lab Manual
94 pages
Data Structures Practical
PDF
No ratings yet
Data Structures Practical
68 pages
Ii-I Aids DS
PDF
No ratings yet
Ii-I Aids DS
86 pages
DSA Lab Manual 1 2 3
PDF
No ratings yet
DSA Lab Manual 1 2 3
25 pages
CS3301 - Data Structures
PDF
No ratings yet
CS3301 - Data Structures
46 pages
Data Structures and Algorithm-SEDA-225-Lab Manual
PDF
No ratings yet
Data Structures and Algorithm-SEDA-225-Lab Manual
41 pages
DSDA Lab Record
PDF
No ratings yet
DSDA Lab Record
77 pages
Data Structure
PDF
No ratings yet
Data Structure
54 pages
Data Structure Lab Manual
PDF
No ratings yet
Data Structure Lab Manual
84 pages
DATA STRUCTURE LAB MANUAL 2020-2021 Final Edited
PDF
100% (2)
DATA STRUCTURE LAB MANUAL 2020-2021 Final Edited
117 pages
DS - Data Structure Lesson Plan 2022-23
PDF
No ratings yet
DS - Data Structure Lesson Plan 2022-23
29 pages
CS211-Data Structures
PDF
No ratings yet
CS211-Data Structures
2 pages
Lab Manual
PDF
No ratings yet
Lab Manual
118 pages
Lab File BCS351
PDF
No ratings yet
Lab File BCS351
8 pages
Csbs Dsa Lab
PDF
No ratings yet
Csbs Dsa Lab
74 pages
DS Lab
PDF
No ratings yet
DS Lab
80 pages
DSA Lab Manual 2022 Scheme
PDF
No ratings yet
DSA Lab Manual 2022 Scheme
67 pages
Data Structure Lab Manual 2021-22
PDF
No ratings yet
Data Structure Lab Manual 2021-22
235 pages
II Year III Sem Cs8351 Data Structures
PDF
No ratings yet
II Year III Sem Cs8351 Data Structures
32 pages
Shaheed Bhagat Singh State Technical Campus: Lab Manual Computer Science & Engineering As Per PTU Syllabus (Revised 2012)
PDF
No ratings yet
Shaheed Bhagat Singh State Technical Campus: Lab Manual Computer Science & Engineering As Per PTU Syllabus (Revised 2012)
2 pages
Dsu Solved Manual
PDF
No ratings yet
Dsu Solved Manual
91 pages
Jan2017 Valen DSA Syllabus
PDF
No ratings yet
Jan2017 Valen DSA Syllabus
9 pages
2-1 Data Structures Lab (16-17)
PDF
No ratings yet
2-1 Data Structures Lab (16-17)
86 pages
Data Structure - Lab Manual 2021r
PDF
No ratings yet
Data Structure - Lab Manual 2021r
67 pages
DATA STRUCTURE RECORD Update
PDF
No ratings yet
DATA STRUCTURE RECORD Update
47 pages
BCS304 Notes
PDF
No ratings yet
BCS304 Notes
167 pages
Department of Artificial Intelligence and Data Science Engineering
PDF
No ratings yet
Department of Artificial Intelligence and Data Science Engineering
66 pages
Laboratory Manual: R. N. G. Patel Institute of Technology
PDF
No ratings yet
Laboratory Manual: R. N. G. Patel Institute of Technology
102 pages
DS Lab Manual (2023-2024)
PDF
No ratings yet
DS Lab Manual (2023-2024)
137 pages
Cs8381 Datastructures Lab Manual Converted 1
PDF
No ratings yet
Cs8381 Datastructures Lab Manual Converted 1
145 pages
DSA Manual
PDF
No ratings yet
DSA Manual
54 pages
Data Structures Lab Manual
PDF
No ratings yet
Data Structures Lab Manual
133 pages