Posts
DS LAB 3/21/2025
- Get link
- X
- Other Apps
#include <stdio.h> #include <limits.h> #include <stdbool.h> #define V 5 int minKey ( int key [] , bool mstSet [] ) { int min = INT_MAX , minIndex ; for ( int v = 0 ; v < V ; v ++ ) { if ( ! mstSet [ v ] && key [ v ] < min ) { min = key [ v ], minIndex = v ; } } return minIndex ; } void printMST ( int parent [] , int graph [ V ][ V ]) { printf ( "Edge \t Weight \n " ); for ( int i = 1 ; i < V ; i ++ ) { printf ( " %d - %d \t %d \n " , parent [ i ], i , graph [ i ][ parent [ i ]]); } } void primMST ( int graph [ V ][ V ]) { int parent [ V ]; int key [ V ]; bool mstSet [ V ]; for ( int i = 0 ; i < V ; i...
ds
- Get link
- X
- Other Apps
#include <stdio.h> #include <stdlib.h> // Define the structure for a node in the tree struct TreeNode { int data; struct TreeNode * left; struct TreeNode * right; }; // Function to create a new node struct TreeNode * createNode ( int data ) { struct TreeNode * newNode = ( struct TreeNode * ) malloc ( sizeof ( struct TreeNode)); newNode -> data = data; newNode -> left = NULL ; newNode -> right = NULL ; return newNode; } // Function to insert a node in the tree (basic BST insert) struct TreeNode * insertNode ( struct TreeNode * root , int data ) { if (root == NULL ) { return createNode (data); // If the tree is empty, create the first node } if (data < root -> data ) { root -> left = insertNode ( root -> lef...
DS LAB BSC(cs) 2nd SEM 2025
- Get link
- X
- Other Apps
Queue Implementation Using Array #include <stdio.h> #include <stdlib.h> #define MAX 5 // maximum size of the queue // Define a Queue structure struct Queue { int front , rear ; int arr [ MAX ]; }; // Function to initialize the queue void initQueue ( struct Queue * q ) { q -> front = - 1 ; q -> rear = - 1 ; } // Check if the queue is empty int isEmpty ( struct Queue * q ) { return ( q -> front == - 1 ); } // Check if the queue is full int isFull ( struct Queue * q ) { return ( q -> rear == MAX - 1 ); } // Enqueue operation (add an element to the queue) void enqueue ( struct Queue * q , int value ) { if ( isFull ( q )) { printf ( "Queue is full! Cannot enqueue %d \n " , value ); } else { if ( q -> front == - 1 ) { // If the queue is empty, initialize front ...
HTML WEB LAB BSC.(CS) 2nd SEM
- Get link
- X
- Other Apps
<!-- 15. Create the following table in HTML with Dummy Data: --> < html > < head > < title > EXP.NO 15 </ title > </ head > < body > < table Border = "10px" width = "500" > < tr > < th > Reg.NO </ th > < th > Student Name </ th > < th > Year </ th > < th > Date of Admission </ th > </ tr > < tr > < td > 202436706 </ td > < td > Samprity </ td > ...
HTML: The Foundation of the Web
- Get link
- X
- Other Apps
HTML: The Foundation of the Web HTML (HyperText Markup Language) is the cornerstone of the World Wide Web. It is the standard language used to create and design webpages, providing the structure that browsers need to display content. Whether you are a seasoned developer or a beginner venturing into web development, understanding HTML is essential for building functional and visually appealing websites. What is HTML? HTML is a markup language used to define the structure of web content. It uses a system of elements, tags, and attributes to organize and present text, images, videos, links, and other multimedia content. HTML is not a programming language but a descriptive language that tells the browser how to display a webpage. Key Features of HTML Structure: HTML organizes content into headings, paragraphs, lists, and sections to create a coherent structure. Media Integration: It allows embedding of images, videos, and audio to enhance user experience. Hyperlinks: HTML ...
HTML: The Foundation of the Web
- Get link
- X
- Other Apps
HTML: The Foundation of the Web HTML (HyperText Markup Language) is the cornerstone of the World Wide Web. It is the standard language used to create and design webpages, providing the structure that browsers need to display content. Whether you are a seasoned developer or a beginner venturing into web development, understanding HTML is essential for building functional and visually appealing websites. What is HTML? HTML is a markup language used to define the structure of web content. It uses a system of elements, tags, and attributes to organize and present text, images, videos, links, and other multimedia content. HTML is not a programming language but a descriptive language that tells the browser how to display a webpage. Key Features of HTML Structure: HTML organizes content into headings, paragraphs, lists, and sections to create a coherent structure. Media Integration: It allows embedding of images, videos, and audio to enhance user experience. Hyperlinks: HTML ...
C-Program of Class 11
- Get link
- X
- Other Apps
1. Define string. Explain any four-string handling function used in C. A String in C programming is a sequence of characters terminated with a null character ‘\0’. The C String is stored as an array of characters. #include <stdio.h> #include <string.h> int main() { char str1[20] = "Hello"; char str2[20] = "World"; char str3[20]; strcpy(str3, str1); printf("Copied string: %s\n", str3); strcat(str2, str1); printf("Concatenates string: %s\n", str1); printf("Length of str1: %lu\n", strlen(str1)); if (strcmp(str1, str2) == 0) printf("str1 and str2 are equal\n"); else if (strcmp(str1, str2) < 0) printf("str1 is less than str2\n"); else printf("str1 is greater than str2\n"); return 0; } strcat(): Concatenates (joins) two stri...
JavaScript and PHP Programs of Class 12
- Get link
- X
- Other Apps
1. Write a program to JavaScript that illustrate event handling. <html> <head> <title>qno1</title> </head> <body onload="alert('this is onload even')";> <input type="button" value="onclickeventishere" onclick="onclickfun()" id="b1"> <input type="button" value="onmouseovereventishere" onmouseover="mover()" id="b2"> <input type="button" value="onmouseoutevenishere" onmouseout="mout()" id="b3"> <script> function onclickfun() { alert('this is onlicked event'); } function mover() { alert('this is mouse over event'); } function mout() { alert('this is mouseout event'); } </script> </body> </html> 2. Write a JavaScript to display 1 to 10 using for loop, while loop, and do-while loop. <script>...
Popular posts from this blog
C-Programming of Class 12
1. Write a program to input any three numbers and find out which one is the largest number using user defined function. #include<stdio.h> int larg_num(int num1, int num2, int num3){ if(num1 >= num2 && num1 >= num3){ return num1; }else if(num2 >=num1 && num2>=num3){ return num2; } else{ return num3; } } int main(){ int num1, num2, num3; scanf("%d%d%d", &num1,&num2,&num3); int largest = larg_num(num1,num2,num3); printf("the largest number is %d",largest); return 0; } 2. Write a program to display the day using the switch statement depending upon the number entered. i.e. input 1 for Sunday, 7 for Saturday using user defined function. #include <stdio.h> char *days(int num) { switch (num) { case 1: ...
C-Program of Class 11
1. Define string. Explain any four-string handling function used in C. A String in C programming is a sequence of characters terminated with a null character ‘\0’. The C String is stored as an array of characters. #include <stdio.h> #include <string.h> int main() { char str1[20] = "Hello"; char str2[20] = "World"; char str3[20]; strcpy(str3, str1); printf("Copied string: %s\n", str3); strcat(str2, str1); printf("Concatenates string: %s\n", str1); printf("Length of str1: %lu\n", strlen(str1)); if (strcmp(str1, str2) == 0) printf("str1 and str2 are equal\n"); else if (strcmp(str1, str2) < 0) printf("str1 is less than str2\n"); else printf("str1 is greater than str2\n"); return 0; } strcat(): Concatenates (joins) two stri...