Skip to main content

Posts

Divide and conquer min max

          Divide and conquer min max  #include<stdio.h> #include<stdio.h> int max, min; int a[100]; void maxmin(int i, int j) {  int max1, min1, mid;  if(i==j)  {   max = min = a[i];  }  else  {   if(i == j-1)   {    if(a[i] >a[j])    {     max = a[i];     min = a[j];    }    else    {     max = a[j];     min = a[i];    }   }   else   {    mid = (i+j)/2;    maxmin(i, mid);    max1 = max; min1 = min;    maxmin(mid+1, j);    if(max <max1)     max = max1;    if(min > min1)     min = min1;   }  } } int main () {  int i, num;  printf ("\nEnter the total number of numbers : ");  scanf ("%d",&num);  printf ("Enter the numbers : \n");  for (i=1;i<=num;i++)   scanf ("%d",&a[i]);  max = a[0];  min = a[0];  maxmin(1, num);  printf ("Minimum element in an array : %d\n", min);  printf ("Maximum element in an array : %d\n", max);  return 0; }

How to Write Merge Sort in C

                    How to Write Merge Sort in C #include<stdio.h> /// Merge Sort void merge(int arr[],int l,int m,int r); void merge_sort(int arr[],int l,int r); void print_arr(int arr[],int size); void merge_sort(int arr[],int l,int r){     if(l<r){         int m=(l+r)/2;         merge_sort(arr,l,m);         merge_sort(arr,m+1,r);         merge(arr,l,m,r);     } } void merge(int arr[],int l,int m,int r){     int i,j,k;     int n1=m-l+1;     int n2=r-m;     int L[n1];     int R[n2];     for(int i=0;i<n1;i++){         L[i]=arr[l+i];     }     for(int j=0;j<n2;j++){         R[j]=arr[m+1+j];     }     i=0;     j=0;     k=l;     while(i<n1 && j<n2){         if(L[i]<=R[j]){             arr[k]=L[i];             i++;         }         else{             arr[k]=R[j];             j++;         }         k++;     }     while(i<n1){         arr[k]=L[i];         i++;         k++;     }     while(j<n2){         arr[k]=R[j];         j++;         k++;     } } void

How Augmented Reality is Changing the Gaming Industry

How Augmented Reality is Changing the Gaming Industry Introduction: Augmented Reality (AR) is taking the gaming industry by storm, offering immersive experiences that blend the virtual and real worlds. In this post, we explore how AR is changing gaming. We also include insightful YouTube videos showcasing some of the most groundbreaking AR games and technologies. The Rise of AR in Gaming: AR technology overlays the real world with digital content, creating unique interactive experiences. Unlike Virtual Reality (VR), where players are fully immersed in a digital environment, AR augments the real world by adding virtual elements. This has created new opportunities for both game developers and players. Key innovations in AR gaming: Mobile AR gaming: Mobile devices have become a powerful AR platform. Games like Pokémon GO and Harry Potter: Wizards Unite show how AR can transform the real world into a gaming playground. Players can explore their surroundings while interacting with virtual c

The Future of Artificial Intelligence: Trends to Watch in 2024

     The Future of Artificial Intelligence: Trends to Watch in 2024 Introduction: Artificial Intelligence (AI) is developing rapidly, impacting various industries and changing the way we live and work. As we look ahead to 2024, several emerging trends in AI are expected to have a major impact. Here are the top AI trends to watch this year. 1. AI in Healthcare: The role of AI in healthcare is growing with advances in predictive analytics, personalized medicine, and diagnostic tools. We can expect to see more AI-driven solutions that can predict patient outcomes, recommend treatments, and even assist with surgery with greater precision. 2. Ethical AI and Regulation: As the influence of AI grows, ethical considerations and regulation are becoming increasingly important. 2024 could see more robust frameworks and policies established to ensure AI is used responsibly and address issues such as bias, privacy, and transparency. 3. AI and Cybersecurity: As cyber threats become more sophisticate

What to Expect from the New iPhone 2024

  What to Expect from the New iPhone 2024 Introduction: Get ready, tech enthusiasts! The highly anticipated release of the new iPhone in 2024 is just around the corner. As Apple continues to push the boundaries of innovation, let's explore the exciting features and updates that are rumored to be part of the upcoming flagship device. Section 1: Cutting-Edge Design and Display Rumors suggest that the new iPhone is set to impress with a sleek and modern design. Expect a stunning display with improved resolution and color accuracy, providing an immersive visual experience for users. Section 2: Performance Boost with the Latest Chipset Apple is known for its powerful A-series chips, and the new iPhone won't be an exception. Anticipate a significant performance boost with the latest and most advanced chipset, ensuring seamless multitasking, faster app launches, and improved energy efficiency. Section 3: Camera Innovations Capture life's moments in unparalleled detail with the

C program to count total number of notes in given amount

 #include <iostream> using namespace std; int main() {     // 500,100,50,20,10,5,2,1     int n;     int count1,count2,count3,count4,count5,count6,count7,count8;     count1=count2=count3=count4=count5=count6=count7=count8=0;     cin>>n;         if(n>=500){           count1=n/500;           n=n%500;         }         if(n>=100){             count2=n/100;             n=n%100;         }         if(n>=50){             count3=n/50;             n=n%50;         }         if(n>=20){             count4=n/20;             n=n%20;         }         if(n>=10){             count5=n/10;             cout<<"10: "<<count5<<endl;             n=n%10;         }         if(n>=5){             count6=n/5;             n=n%5;         }         if(n>=2){             count7=n/2;             n=n%2;         }         if(n>=1){            count8=n/1;             n=n%1;         }         cout<<"500: "<<count1<<endl;         cou

"Unlocking the Power of the Internet of Things"

"Unlocking the Power of the Internet of Things" Introduction: Welcome to the digital revolution powered by the Internet of Things (IoT). In this article, we dive into the fascinating world of IoT and its profound impact on our lives. From smart homes to industrial automation, IoT has the potential to revolutionize the way we live, work, and interact with the world around us. Understanding the Internet of Things: In this section, we provide a comprehensive overview of what the Internet of Things is and how it works. We explore the concept of interconnected devices, sensors, and data analytics, showcasing the underlying technologies that make IoT possible. Real-World Applications: IoT is not just a concept; it's a reality with tangible applications across various industries. We delve into some exciting use cases, such as smart homes, wearable devices, healthcare monitoring, agriculture, and transportation. Discover how IoT is transforming these sectors and the benefits it b