Posts

Showing posts from July, 2020

Linkedklist insert at begining in c

/*createtor sarkarsumit.blogspot.com*/ #include<stdio.h> #include<stdlib.h> struct node {     int data;     struct node *next; }; typedef struct node node; //functionto create a linked list node * createLinkedlist(int n); void display(node *start); node *insertBeg(node *head); int main() {     int n=0;     node *head=NULL;     node * HEAD =NULL; //address of first node     printf("ENter Number of nodes : ");     scanf("%d",&n);     HEAD = createLinkedlist(n);     display(HEAD);     HEAD=insertBeg(HEAD);     display(HEAD);     return 0; } node *createLinkedlist(int n) {     int i=0;     node *head=NULL;     node *temp=NULL;     node *p = NULL;     for(i=0;i<n;i++)     {         //create indibidual isolated nodes         temp=(node*)malloc(sizeof(node));...

Linked list Deletion in c

#include<stdio.h> #include<stdlib.h> struct node {     int data;     struct node *next; }; typedef struct node node; //functionto create a linked list node * createLinkedlist(int n); void display(node *start); node* deletenode(node *head,int pos); int main() {     int n=0,k=0;     node *head=NULL;     node * HEAD =NULL; //address of first node     printf("ENter Number of nodes : ");     scanf("%d",&n);     HEAD = createLinkedlist(n);     display(HEAD);     printf("Enter position to delete a node");     scanf("%d",&k);     HEAD=deletenode(HEAD,k);     display(HEAD);     return 0; } node* deletenode(node* head, int pos) {    node *i,*j;     int count=0;     if(pos==0 &&head->next!=NULL){         j=head;         head=head->next;       ...

Linked list insertion insertion and display

#include<stdio.h> #include<stdlib.h> struct node {     int data;     struct node *next; }; typedef struct node node; //functionto create a linked list node * createLinkedlist(int n); void display(node *start); int main() {     int n=0;     node *head=NULL;     node * HEAD =NULL; //address of first node     printf("ENter Number of nodes : ");     scanf("%d",&n);     HEAD = createLinkedlist(n);     display(HEAD);     return 0; } node *createLinkedlist(int n) {     int i=0;     node *head=NULL;     node *temp=NULL;     node *p = NULL;     for(i=0;i<n;i++)     {         //create indibidual isolated nodes         temp=(node*)malloc(sizeof(node));         printf("enter data for %d",(i+1));         scanf("%d",&temp->data);   ...

Blogging Website using Python-flask,MySql,Bootstrap 4

Image
Project must be save in a folder Template for Html files Static for Media /Javascript/any other files Python code must be save as Main.py  main.py :        from flask import Flask , render_template , request , session , redirect , flash from flask_sqlalchemy import SQLAlchemy from datetime import datetime import json from werkzeug . utils import secure_filename import os import math from flask_mail import Mail with open ( 'config.json' , 'r' ) as c : params = json . load ( c )[ "params" ] local_server = True app = Flask ( __name__ ) app . secret_key = 'super-secret-key' app . config [ 'UPLOAD_FOLDER' ] = params [ 'uploader location' ] '''mail setup starts::::''' app . config . update ( MAIL_SERVER = 'smtp.gmail.com' , MAIL_PORT = '465' , MAIL_USE_SSL = True , MAIL_USERNAME = params [ 'gmail_username' ], MAIL_PASSWORD = para...