diff --git a/README.md b/README.md index 5632563e2..c147c25ca 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,4 @@ - [Lectures](https://www.youtube.com/playlist?list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ) - [Course website](https://www.techwithkunal.com/courses/dsa) - [Assignments](https://github.com/kunal-kushwaha/DSA-Bootcamp-Java/tree/main/assignments) (solutions can be found on LeetCode) +## this is testing commit diff --git a/SYLLABUS.md b/SYLLABUS.md index e9c72d5f2..4a067f9df 100644 --- a/SYLLABUS.md +++ b/SYLLABUS.md @@ -1,3 +1,5 @@ + + - [Complete Git & GitHub Course](https://youtu.be/apGV9Kg7ics) - [Introduction to Programming](https://youtu.be/wn49bJOYAZM) - [Types of languages](https://youtu.be/wn49bJOYAZM?t=171) diff --git a/classes/day1/dayOne.java b/classes/day1/dayOne.java new file mode 100644 index 000000000..560c65c0f --- /dev/null +++ b/classes/day1/dayOne.java @@ -0,0 +1,35 @@ +public class dayOne{ + public static void main(String[] args) { + // types of language + // procedural + // functional + // object - oriendted + + + // static and dynamic language + /* + * STATIC = perform type checking at compile time + * delclare dataytpe before you use it , we need to specifies the data type + * give more control + * + * DYNAMIC = perform type checking at run time + * error will show till program runn + * easy to write code , + * save time + * no need to declare the datatypes of variables + * + */ + + + // STACK and HEAP memory + /* + * stack store the refernce pointing the object that is acutlly stored in heap + more than one reference variable of one object + + */ + // java follow pass by reference + // it dosent have the pass by copy + // garbage collection : none any reference pointyer is pointd toward this object + + } +} \ No newline at end of file diff --git a/classes/day1/dayTwo.java b/classes/day1/dayTwo.java new file mode 100644 index 000000000..49b8b3b45 --- /dev/null +++ b/classes/day1/dayTwo.java @@ -0,0 +1,6 @@ +public class dayTwo { + /* + * flowchart is used for represnt the flow of the program using a set of symbols such as rectangle , sqauare , oval , parrelogram and etc + * prime or not + */ +} diff --git a/classes/day2/Assignment.java b/classes/day2/Assignment.java new file mode 100644 index 000000000..e20c386c6 --- /dev/null +++ b/classes/day2/Assignment.java @@ -0,0 +1,41 @@ +import java.util.Scanner; + +public class Assignment { + public static void main(String[] args) { + // program to even and odd + // defining the scanner + Scanner input = new Scanner(System.in); + // int a ,b; + // System.out.println("enter the number"); + // a = input.nextInt(); + // if(a%2==0){ + // System.out.println("the number is even"); + // }else{ + // System.out.println("the number is odd"); + // } assignment 1.1 + +// String name ; +// name = input.next(); +// String greet = "hello"+name; +// // System.out.println(greet); + +// calc + System.out.println("enter two number"); + int a = input.nextInt(); + int b = input.nextInt(); + System.out.println("enter the operator"); + String ch = input.next(); + if(ch == "+"){ + System.out.println(a+b); + } else if (ch == "-") { + System.out.println(a-b); + } else if (ch == "*") { + System.out.println(a*b); + + }else{ + System.out.println("worng input"); + } + + + } +} diff --git a/classes/day2/Main.java b/classes/day2/Main.java new file mode 100644 index 000000000..7efe812f4 --- /dev/null +++ b/classes/day2/Main.java @@ -0,0 +1,31 @@ +import java.nio.file.LinkPermission; +import java.security.spec.RSAOtherPrimeInfo; +import java.util.Scanner; +public class Main { + public static void main(String[] args) { + System.out.println("this "); + // to display something these have a class know as System + System.out.print("this is a single line"); + + System.out.println("rahul kumar"); + + // inputs in java Scanner class + // it is availabe in Scanner class +// Scanner sc = new Scanner(System.in); +// System.out.println(sc.nextInt()); + +// int a = 2300_000; +// System.out.print(a); + + float num; + Scanner sc = new Scanner(System.in); + System.out.println("enter the float number"); + num = sc.nextFloat(); + System.out.println(num); + + + + + + } +} diff --git a/classes/day2/TypeConversion.java b/classes/day2/TypeConversion.java new file mode 100644 index 000000000..6f83212ee --- /dev/null +++ b/classes/day2/TypeConversion.java @@ -0,0 +1,20 @@ +package day2; + +import java.util.Scanner; + +public class TypeConversion { + public static void main(String[] args) { + // chainging the type from one datatype to another + Scanner sc = new Scanner(System.in); + // type should be compactable + // destination should be greater than source + // type casting = implicit int to float + // type casting = explicit like float to int + int num = (int)(67.555f); +// System.out.println(num); + int a = 766; + byte b = (byte) (a); +// System.out.println(b); + } +} + diff --git a/classes/day2/sum.java b/classes/day2/sum.java new file mode 100644 index 000000000..1b5c4de8e --- /dev/null +++ b/classes/day2/sum.java @@ -0,0 +1,19 @@ +package day2; + +import java.util.Scanner; + +public class sum { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.print(("enter the first number ")); + int num1 = sc.nextInt(); + + System.out.print(("enter the second number ")); + int num2 = sc.nextInt(); + int sum = num2+num1; + + System.out.println("the additon is "+ sum); + + + } +} diff --git a/classes/day2/temperature.java b/classes/day2/temperature.java new file mode 100644 index 000000000..093a8c079 --- /dev/null +++ b/classes/day2/temperature.java @@ -0,0 +1,15 @@ +package day2; + +import java.util.Scanner; +public class temperature { + public static void main(String[] args) { + Scanner ip = new Scanner(System.in); + + System.out.println("enter the celcius "); + float tempC = ip.nextFloat(); + + float tempF = (tempC * 9/5)+32; + System.out.println("the temp in f is: "+ tempF); + + } +} diff --git a/classes/day4/LeapYear.java b/classes/day4/LeapYear.java new file mode 100644 index 000000000..43d54f1ae --- /dev/null +++ b/classes/day4/LeapYear.java @@ -0,0 +1,19 @@ +public class LeapYear { + public static void main(String[] args) { + int date = 2025; + // System.out.println(leapYear(date)); + System.out.println(leapYear(date)); + } + public static boolean leapYear(int num){ + + // leap year must be divisible by 4 ; + // leap year must be divisble by 400 ; + // and it is not divisible by 100; + if ((num % 4 == 0 && num % 100 != 0) || (num % 400 == 0)) { + return true; + } + + return false; + + } +} diff --git a/classes/day4/TypeCheck.java b/classes/day4/TypeCheck.java new file mode 100644 index 000000000..ca04c89e1 --- /dev/null +++ b/classes/day4/TypeCheck.java @@ -0,0 +1,15 @@ +import java.util.Scanner; +public class TypeCheck { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + char ch = sc.next().trim().charAt(0); + System.out.println(ch); + if(ch =='a' && ch<='z'){ + System.out.println("this is lowercase"); + }else{ + System.out.println("this is lowerCase"); + } + + + } +} diff --git a/classes/day4/countingOccurence.java b/classes/day4/countingOccurence.java new file mode 100644 index 000000000..bea8171a7 --- /dev/null +++ b/classes/day4/countingOccurence.java @@ -0,0 +1,18 @@ +public class countingOccurence { + public static void main(String[] args) { + int number = 17385789; + int cnt =0; + + while(number>0){ + + int lastDigit = number%10; + number = number/10; + if(lastDigit ==7){ + cnt++; + } + + } + + System.out.println(cnt); + } +} diff --git a/classes/day4/fib.java b/classes/day4/fib.java new file mode 100644 index 000000000..fcd319c57 --- /dev/null +++ b/classes/day4/fib.java @@ -0,0 +1,19 @@ +import java.util.Scanner; + +public class fib { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int a =0; + int b =1; + int n = sc.nextInt(); + for(int i =0;i0){ + int rem = n%10; + rev = rev*10+rem; + n=n/10; + + } + System.out.println(("this is the reversh "+ rev)); + System.out.println(("this is the org "+ temp)); + + } +} diff --git a/lectures/20-trees/code/AVL/.project b/lectures/20-trees/code/AVL/.project index a2380fe36..ec6877f7d 100644 --- a/lectures/20-trees/code/AVL/.project +++ b/lectures/20-trees/code/AVL/.project @@ -22,12 +22,12 @@ - 1679078569810 + 1752690996261 30 org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ diff --git a/lectures/20-trees/code/Questions/.project b/lectures/20-trees/code/Questions/.project index a2380fe36..af02e4a6b 100644 --- a/lectures/20-trees/code/Questions/.project +++ b/lectures/20-trees/code/Questions/.project @@ -22,12 +22,12 @@ - 1679078569810 + 1752690996278 30 org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__