Strings Operations in Data Structures (C)

  Length of string #include <stdio.h> int main() { char s[] = “Dhiraj”; int i=0; while(s[i] != ”) { i++; } printf(“length of string is %d”, i); return 0; } Changing Case #include <stdio.h> int main() { char s[] = “dhiraj”; int i=0; while(s[i] != ”) { if(s[i] >= 65 && s[i] <=90) s[i] = … Read more

Strings in Data Structures (C)

Strings are defined as an array of characters. The difference between a character array and string is terminated with a special ‘’ at the end, just like how you would write out numbers or letters in the text but not symbols! Let’s understand ASCII codes first. ASCII, abbreviated from American Standard Code for Information Interchange, is … Read more

What problems can be solved using recursion?

In this tutorial we will look some great problems which can be solved using recursion.      Sum of N Explanation: 1+2+3+4….n we need to print the output of sum of n. // 1+2+3+4…+n #include <stdio.h> int sum(int n) { if(n==0) { return 0; } return sum(n-1)+n; } int main(void) { printf(“%d”, sum(4)); return 0; … Read more

Flask Cheat Sheet (2022)

Flask is a Python web microframework. It provides a simple interface to create HTTP middleware, URLs, views, and more! This is a quick guide on how to get started with the Flask Framework. This free download will help you create beautiful, responsive websites quickly and easily! Cheat sheets are important because they allow you to … Read more

Realtime chat app using flask

Hey, In this tutorial we will look at how we can create a real-time chat app using python, flask, socketIO. First of all, you need to install requirements (pip install requirements.txt) Now, we are creating the main python file let’s name it from flask import Flask, render_template, request from flask_socketio import SocketIO, send app … Read more

Linked List Operations in Data Structures

Create and Display LL #include <stdio.h> #include <stdlib.h> struct Node { int data; struct Node *next; }*first=NULL; void create(int A[], int n) { int i; struct Node *t ,*last; first = (struct Node *)malloc(sizeof(struct Node)); first->data=A[0]; first->next=NULL; last=first; for(i=1; i<n; i++) { t = (struct Node*)malloc(sizeof(struct Node)); t->data=A[i]; t->next=NULL; last->next=t; last=t; } } void Display(struct … Read more

Linked List in Data Structures

Why Linked List? Problems with an array Array is Fixed-size for example a[10] toh 10 se jyada store nahi ho skta aur agar 2 elements hi hai toh baaki sab jagh waste ho rahi hai int a[5]; -> array in stack int *p = new int[5]; -> array in heap Benefit: arrays are contiguous toh … Read more

Array ADT in Data Structures

Now it’s time to move on from the array representation and learn some of its abstract data type operations. In simple words, we’ll see how arrays work! I will make it simple and complete into one single program, I create functions for each operation. This program updates in the future too! In this program, I … Read more

Array Representation in Data Structures

int a[5]; //Garbage value int a[5]={1,2,3,4,5}; //initialize and declare int a[] = {1,2,3,4,5}; //iterating the array int a[5] = {1,2,3,4,5}; for(i=0;i<5;i++) { printf(“%d”, a[i]); } The array is a container that can hold a fixed number of items and these items should be of the same type. Most of the data structures make use of … Read more

What is Recursion? Types of Recursion.

Hello guys, In this tutorial we are going to see what recursion is?     The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive function. Using a recursive algorithm, certain problems can be solved quite easily. And it is one of the … Read more