Posts

To Connect Java program with the MYSQL Database

Image
To connect java application with the MYSQL database, first of all to install MYSQL database in your machine. To install MYSQL in your machine then follow the below steps: 1) To download MYSQL database on its official website : https://dev.mysql.com/downloads/installer/ 2) After that double click on this exe file and run the installer. Choose Full setup option and click next. 3) Execute the entire file and wait to complete to install. 4) Next to check product configuration. 5) In this step choose port number. Default port number is 3306. If it was already acquired by other application like WAMP server or apache server, then change its value like 3307 or 3308. 6)    After that select authentication method. Select recommended method. 7) Choose password and user account as per your choice. 8) Follow next step and finish the installation process. Watch this video to install MYSQL installation process:   https://youtu.be/QqFWLDSgedg?si=4yvPUXTUQI0DRX2P   To conn...

SYBSc (CS) Sem III : Data Structure Slip 20 Que - 2

    SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination       SUBJECT: CS-233 Practical course based on CS231  /* Q2. There are lists where new elements are always appended at the end of the  list. The list can be implemented as a circular list with the external pointer  pointing to the last element of the list. Implement singly linked circular list  of integers with append and display operations. The operation append(L, n), appends  to the end of the list, n integers either accepted from user or randomly generated. */ #include<stdio.h> #include<stdlib.h> struct node { int data; struct node *next; }; struct node * create(struct node *head) { struct node *newnode = NULL, *temp = NULL; newnode = (struct node*) malloc(sizeof(struct node)); if(newnode!=NULL) {     printf("Enter node data");     scanf("%d",&(newnode->data));   ...

SYBSc (CS) Sem III : Data Structure Slip 14 Que - 2

  SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination       SUBJECT: CS-233 Practical course based on CS231  /* Q. 2 A doubly ended queue allows additions and deletions from both the ends that  is front and rear. Initially additions from the front will not be possible. To avoid this situation, the array can be treated as if it were circular. Implement a  queue library (dstqueue.h) of integers using a static implementation of the  circular queue and implementing the following operations.  a. isFull(Q) b. addFront(Q) c. getRear(Q) d. deleteRear(Q) */ // File name : "dstqueue.c" #include"dstqueue.h" int init(struct Queue *q) {     q->front = q->rear = -1; } int isEmpty(struct Queue *q) {     if(q->front == q->rear)     {        return 1;     }     else{        return 0;     } } int isFul...

SYBSc (CS) Sem III : Data Structure Slip 11 Que - 2

      SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination       SUBJECT: CS-233 Practical course based on CS231  /* Q. 2 Implement a priority queue library (Priority.h) of integers using a  static implementation of the queue and implementing the below two operations.  Write a driver program that includes queue library and calls different queue  operations. 1) Add an element with its priority into the queue. 2) Delete an element from queue according to its priority.  */ // File name : "PriorityQ.c" #include"PriorityQ.h" int initPQ(struct PriorityQueue *pq) {     pq->front = pq->rear = -1;     return 0; } int isFullPQ(struct PriorityQueue *pq) {     if(pq->rear == MAX-1)         return 1;     else         return 0; } int isEmptyPQ(struct PriorityQueue *pq) {     if(pq->front == -1) ...

SYBSc (CS) Sem III : Data Structure Slip 21 Que - 2

    SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination       SUBJECT: CS-233 Practical course based on CS231  /* Q. 2. Read the data from the file "employee.txt" and sort on names in  alphabetical order (use strcmp) using insertion sort and selection sort */ // File Name: "employee.txt" (This file create separate with txt extension and save in current folder.) John Aniket Julie Dolly Rosemary // File Name: "Slip21_2.c" #include<stdio.h> #include<stdlib.h> #define MAX 20 typedef struct employee{         char name[MAX]; }record; record emp[MAX]; int read_file(record *a){     int i = 0;     FILE *fp;        if ((fp = fopen("employee.txt", "r")) != NULL)     {             while (!feof(fp)){                   fscanf(fp, "%s", a[i].name);     ...

SYBSc (CS) Sem III : Data Structure Slip 21 Que - 1

    SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination       SUBJECT: CS-233 Practical course based on CS231  /* Q. 1. Write a program that reverses a string of characters. The function should  use a stack library (cststack.h). Use a static implementation of the stack. */ /// File name : "cststack.h" #include"cststack.h" int init(struct Stack *s) {     s->top = -1; } int isEmpty(struct Stack *s) {     if(s->top == -1)     {        return 1;     }     else{        return 0;     } } int isFull(struct Stack *s) {     if(s->top == MAX-1)     {        return 1;     }     else{        return 0;     } } int Push(struct Stack *s, char x) {     if(isFull(s) == 1)     {        p...

SYBSc (CS) Sem III : Data Structure Slip 17 Que - 2

    SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination       SUBJECT: CS-233 Practical course based on CS231  /* Q. 2. Write a program that copies the contents of one stack into another. Use  stack library to perform basic stack operations. The order of two stacks must be  identical. (Hint: Use a temporary stack to preserve the order). */ /// File name : "stack.c" #include"stack.h" int init(struct Stack *s) {     s->top = -1; } int isEmpty(struct Stack *s) {     if(s->top == -1)     {        return 1;     }     else{        return 0;     } } int isFull(struct Stack *s) {     if(s->top == MAX-1)     {        return 1;     }     else{        return 0;     } } int Push(struct Stack *s, int n) {   ...