Channel: Advance Java π¨βπ»
58. Merge two array.
class MergeArrayDemo
{
public static void main(String args[])
{
Integer a[]={1,2,3,4};
Integer b[]={5,6,7,0};
Integer[] both = concat(a, b);
System.out.print("\nFirst Array : ");
for(int i=0;i<a.length;i++)
{
System.out.print(a[i]+"\t");
}
System.out.print("\nSecond Array : ");
for(int i=0;i<b.length;i++)
{
System.out.print(b[i]+"\t");
}
System.out.print("\nMerged Array : ");
for(int i=0;i<both.length;i++)
{
System.out.print(both[i]+"\t");
}
}
public static Integer[] concat(Integer[] a, Integer[] b)
{
int aLen = a.length;
int bLen = b.length;
Integer[] c= new Integer[aLen+bLen];
System.arraycopy(a, 0, c, 0, aLen);
System.arraycopy(b, 0, c, aLen, bLen);
return c;
}
}
@java_codings
class MergeArrayDemo
{
public static void main(String args[])
{
Integer a[]={1,2,3,4};
Integer b[]={5,6,7,0};
Integer[] both = concat(a, b);
System.out.print("\nFirst Array : ");
for(int i=0;i<a.length;i++)
{
System.out.print(a[i]+"\t");
}
System.out.print("\nSecond Array : ");
for(int i=0;i<b.length;i++)
{
System.out.print(b[i]+"\t");
}
System.out.print("\nMerged Array : ");
for(int i=0;i<both.length;i++)
{
System.out.print(both[i]+"\t");
}
}
public static Integer[] concat(Integer[] a, Integer[] b)
{
int aLen = a.length;
int bLen = b.length;
Integer[] c= new Integer[aLen+bLen];
System.arraycopy(a, 0, c, 0, aLen);
System.arraycopy(b, 0, c, aLen, bLen);
return c;
}
}
@java_codings
59. Middle value of an array.
import java.util.*;
class MiddleValue
{
public static void main(String args[])
{
int[] a;
int i, j, n, sum = 0, swap, size;
double t;
Scanner sc = new Scanner(System.in);
System.out.println("Enter size of array");
size = sc.nextInt();
a = new int[size];
System.out.println("Enter numbers ");
for (i = 0; i < size; i++)
{
a[i] = sc.nextInt();
}
System.out.println("Numbers are : ");
for (i = 0; i < size; i++)
{
System.out.print(a[i] + " ");
}
//Sorting
for (i = 0; i < (size - 1); i++)
{
for (j = 0; j < (size - i - 1); j++)
{
if (a[j] > a[j + 1])
{
swap = a[j];
a[j] = a[j + 1];
a[j + 1] = swap;
}
}
}
System.out.println("\nNumbers in sorted order : ");
for (i = 0; i < size; i++)
{
System.out.print(a[i] + " ");
}
//Finding the Middle Value
if (size % 2 == 0)
{
n = (size + 1) / 2;
t = (a[n] + a[n - 1]) / 2.0;
System.out.println("\nMiddle Value is : " + t);
}
else
{
System.out.println("\nMiddle Value is : " + a[size / 2]);
}
}
}
@java_codings
import java.util.*;
class MiddleValue
{
public static void main(String args[])
{
int[] a;
int i, j, n, sum = 0, swap, size;
double t;
Scanner sc = new Scanner(System.in);
System.out.println("Enter size of array");
size = sc.nextInt();
a = new int[size];
System.out.println("Enter numbers ");
for (i = 0; i < size; i++)
{
a[i] = sc.nextInt();
}
System.out.println("Numbers are : ");
for (i = 0; i < size; i++)
{
System.out.print(a[i] + " ");
}
//Sorting
for (i = 0; i < (size - 1); i++)
{
for (j = 0; j < (size - i - 1); j++)
{
if (a[j] > a[j + 1])
{
swap = a[j];
a[j] = a[j + 1];
a[j + 1] = swap;
}
}
}
System.out.println("\nNumbers in sorted order : ");
for (i = 0; i < size; i++)
{
System.out.print(a[i] + " ");
}
//Finding the Middle Value
if (size % 2 == 0)
{
n = (size + 1) / 2;
t = (a[n] + a[n - 1]) / 2.0;
System.out.println("\nMiddle Value is : " + t);
}
else
{
System.out.println("\nMiddle Value is : " + a[size / 2]);
}
}
}
@java_codings
60. Mirror Matrix.
import java.util.*;
class MirrorMatrix
{
public static void main(String[] args)
{
int row, column;
Scanner in = new Scanner(System.in);
System.out.print("Enter number of rows for matrix :");
row = in.nextInt();
System.out.print("Enter number of rows for matrix :");
column = in.nextInt();
int matrix[][] = new int[row][column];
System.out.println("Enter matrix : ");
for (int i = 0; i < row; i++)
{
for (int j = 0; j < column; j++)
{
matrix[i][j] = in.nextInt();
}
}
System.out.println("Mirror matrix : ");
for (int i = 0; i < row; i++)
{
for (int j = column - 1; j >= 0; j--)
{
System.out.print(matrix[i][j] + "\t");
}
System.out.println("");
}
}
}
@java_codings
import java.util.*;
class MirrorMatrix
{
public static void main(String[] args)
{
int row, column;
Scanner in = new Scanner(System.in);
System.out.print("Enter number of rows for matrix :");
row = in.nextInt();
System.out.print("Enter number of rows for matrix :");
column = in.nextInt();
int matrix[][] = new int[row][column];
System.out.println("Enter matrix : ");
for (int i = 0; i < row; i++)
{
for (int j = 0; j < column; j++)
{
matrix[i][j] = in.nextInt();
}
}
System.out.println("Mirror matrix : ");
for (int i = 0; i < row; i++)
{
for (int j = column - 1; j >= 0; j--)
{
System.out.print(matrix[i][j] + "\t");
}
System.out.println("");
}
}
}
@java_codings
61. Missing number in an array.
class MissingNumberArray
{
public static int count = 0;
public static int position = 0;
public static boolean flag = false;
public static void main(String[] args)
{
int a[] = {0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 20, 21, 23};
findMissingNumbers(a, position);
}
private static void findMissingNumbers(int a[], int position)
{
if (position == a.length - 1)
return;
for (; position < a[a.length - 1]; position++)
{
if ((a[position] - count) != position)
{
System.out.println("Missing Number: " + (position + count));
flag = true;
count++;
break;
}
}
if (flag)
{
flag = false;
findMissingNumbers(a, position);
}
}
}
@java_codings
class MissingNumberArray
{
public static int count = 0;
public static int position = 0;
public static boolean flag = false;
public static void main(String[] args)
{
int a[] = {0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 20, 21, 23};
findMissingNumbers(a, position);
}
private static void findMissingNumbers(int a[], int position)
{
if (position == a.length - 1)
return;
for (; position < a[a.length - 1]; position++)
{
if ((a[position] - count) != position)
{
System.out.println("Missing Number: " + (position + count));
flag = true;
count++;
break;
}
}
if (flag)
{
flag = false;
findMissingNumbers(a, position);
}
}
}
@java_codings
62. Multidimensional Array.
class MultiDimArrayExample
{
public static void main(String[] args)
{
String[][] names = {{"Mr. ", "Mrs. ", "Ms. "}, {"Smith", "Jones"}};
// Mr. Smith
System.out.println(names[0][0] + names[1][0]);
// Ms. Jones
System.out.println(names[0][2] + names[1][1]);
}
}
@java_codings
class MultiDimArrayExample
{
public static void main(String[] args)
{
String[][] names = {{"Mr. ", "Mrs. ", "Ms. "}, {"Smith", "Jones"}};
// Mr. Smith
System.out.println(names[0][0] + names[1][0]);
// Ms. Jones
System.out.println(names[0][2] + names[1][1]);
}
}
@java_codings
Check out Advance Java: https://hottg.com/+UEKAm2OSf7thOTk1
Telegram
Advance Java programming
ΟΡΞΉΞΉ Β’ΟΠΌΡ ΡΟ
https://youtube.com/@codingfragments?si=g21jjjTZ1T07VWXX
Check out this YouTube channel to learn the programming language.
Check out this YouTube channel to learn the programming language.
Javascript Tutorial:
https://www.youtube.com/watch?v=wm6LNo6715o&list=PLcGjb_nf4rNwdtG7JP0j0qcgAZ74b4-5A
https://www.youtube.com/watch?v=wm6LNo6715o&list=PLcGjb_nf4rNwdtG7JP0j0qcgAZ74b4-5A
YouTube
JavaScript Tutorial for Beginners In Hindi
#javascript_tutorial #javascript_tutorial_in_hindi #logical_programming
Are you new to JavaScript and eager to start your coding journey? Look no further! In this comprehensive JavaScript tutorial, we'll take you from the very basics to more advanced conceptsβ¦
Are you new to JavaScript and eager to start your coding journey? Look no further! In this comprehensive JavaScript tutorial, we'll take you from the very basics to more advanced conceptsβ¦
Node js tutorial: https://www.youtube.com/watch?v=XkpbjI_GyJo&list=PLcGjb_nf4rNxR1eCFakb_-4TUA4FCOW9q
YouTube
Node js tutorial for beginners in hindi
#nodejs #nodejsinhindi #nodejs_tutorial #nodejstutorial #nodejsdevelopment
Are you curious about Node.js and its role in modern web development? π Join us in this Node.js introduction video where we demystify the fundamentals of Node.js!
In this beginnerβ¦
Are you curious about Node.js and its role in modern web development? π Join us in this Node.js introduction video where we demystify the fundamentals of Node.js!
In this beginnerβ¦
Advance Java π¨βπ» pinned Β«https://youtube.com/@codingfragments?si=g21jjjTZ1T07VWXX Check out this YouTube channel to learn the programming language.Β»
Advance Java π¨βπ» pinned Β«Javascript Tutorial: https://www.youtube.com/watch?v=wm6LNo6715o&list=PLcGjb_nf4rNwdtG7JP0j0qcgAZ74b4-5AΒ»
Advance Java π¨βπ» pinned Β«Node js tutorial: https://www.youtube.com/watch?v=XkpbjI_GyJo&list=PLcGjb_nf4rNxR1eCFakb_-4TUA4FCOW9qΒ»
Webscraping of flipkart product using node js with practical example.
https://youtu.be/_Q0EMB1McXE
Please like, share and subscribe
https://youtu.be/_Q0EMB1McXE
Please like, share and subscribe
YouTube
How to scrap web using nodejs with demo
#webscraping #cheerio #nodejs
Learn how to perform web scraping using Node.js in this comprehensive tutorial.
We'll cover following points
- Web scraping Introduction
- Installtion of cheerio with nodejs
- Scrap data of flipkart products
Whether you'reβ¦
Learn how to perform web scraping using Node.js in this comprehensive tutorial.
We'll cover following points
- Web scraping Introduction
- Installtion of cheerio with nodejs
- Scrap data of flipkart products
Whether you'reβ¦
Advance Java π¨βπ» pinned Β«Webscraping of flipkart product using node js with practical example. https://youtu.be/_Q0EMB1McXE Please like, share and subscribeΒ»
https://youtu.be/osLDmH6KBmQ
Explore detailed insight of tree shaking in javascript to boost your application 10x times faster.
Explore detailed insight of tree shaking in javascript to boost your application 10x times faster.
YouTube
Tree Shaking In Javascript With Demo || Optimize Your Nodejs, React, Angular, Vue App
#treeshaking #deadcoderemoval #webpack #optimization
Learn all about tree shaking in JavaScript and how to leverage this powerful technique to remove dead code from your projects, resulting in faster load times and smaller bundle sizes. Discover the bestβ¦
Learn all about tree shaking in JavaScript and how to leverage this powerful technique to remove dead code from your projects, resulting in faster load times and smaller bundle sizes. Discover the bestβ¦
MySQL complete course for beginners
https://www.youtube.com/playlist?list=PLcGjb_nf4rNwjUe74arheIyIRJqdIjh1B
https://www.youtube.com/playlist?list=PLcGjb_nf4rNwjUe74arheIyIRJqdIjh1B
Learn the basics of reacjs and setup themes from scratch.
https://youtube.com/playlist?list=PLcGjb_nf4rNw89854fHsqHTeCpLaNgoEw&si=J90lPx8hFLHlqRmM
You will learn in this series.
1. How to set up the project theme
2. Best practices and tips for folder structure in ReactJS
3. Basics of React
4. How to create a reusable component and reuse it in a project.
5. How to create a theme layout
6. State and Props (pass data between components)
https://youtube.com/playlist?list=PLcGjb_nf4rNw89854fHsqHTeCpLaNgoEw&si=J90lPx8hFLHlqRmM
You will learn in this series.
1. How to set up the project theme
2. Best practices and tips for folder structure in ReactJS
3. Basics of React
4. How to create a reusable component and reuse it in a project.
5. How to create a theme layout
6. State and Props (pass data between components)
HTML Embed Code: