not possible to send folders as it contains more than 2000 files i will update on my git kindly go through
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class TestEmp {
public static void main(String[] args ) {
List<Employeee1> empList = new ArrayList<>();
empList.add(new Employeee1(1, 10000));
empList.add(new Employeee1(2, 15000));
empList.add(new Employeee1(3, 12000));
System.out.println("Before Total Sal----------------");
empList.forEach(System.out::println);
// for(Employeee1 e : empList) {
// int da = (int) (e.basicSal * 0.2);
// int hra = (int) (e.basicSal * 0.3);
// e.totalSal = da + hra + e.basicSal;
// }
// System.out.println("After Total sal----------------");
// empList.forEach(System.out::println);
//
// List<Employeee1> lowSal = new ArrayList<>();
// for(Employeee1 e : empList) {
// if(e.totalSal < 20000) {
// e.totalSal += 5000;
// lowSal.add(e);
// }
// }
//
// System.out.println("After Low----------------");
// lowSal.forEach(System.out::println);
System.out.println("Streams------------");
List<Employeee1> streamList = empList.stream().map(e -> {
int da = (int) (e.basicSal * 0.2);
int hra = (int) (e.basicSal * 0.3);
e.totalSal = da + hra + e.basicSal;
return e;
}).collect(Collectors.toList());
for(Employeee1 e : streamList) {
System.out.println(e.toString());
}
System.out.println("Streams low sal------------");
streamList.stream().filter(e -> e.totalSal < 20000).map(e -> {
e.totalSal += 5000;
return e;
}).forEach(System.out::println);
}
}
import java.util.List;
import java.util.stream.Collectors;
public class TestEmp {
public static void main(String[] args ) {
List<Employeee1> empList = new ArrayList<>();
empList.add(new Employeee1(1, 10000));
empList.add(new Employeee1(2, 15000));
empList.add(new Employeee1(3, 12000));
System.out.println("Before Total Sal----------------");
empList.forEach(System.out::println);
// for(Employeee1 e : empList) {
// int da = (int) (e.basicSal * 0.2);
// int hra = (int) (e.basicSal * 0.3);
// e.totalSal = da + hra + e.basicSal;
// }
// System.out.println("After Total sal----------------");
// empList.forEach(System.out::println);
//
// List<Employeee1> lowSal = new ArrayList<>();
// for(Employeee1 e : empList) {
// if(e.totalSal < 20000) {
// e.totalSal += 5000;
// lowSal.add(e);
// }
// }
//
// System.out.println("After Low----------------");
// lowSal.forEach(System.out::println);
System.out.println("Streams------------");
List<Employeee1> streamList = empList.stream().map(e -> {
int da = (int) (e.basicSal * 0.2);
int hra = (int) (e.basicSal * 0.3);
e.totalSal = da + hra + e.basicSal;
return e;
}).collect(Collectors.toList());
for(Employeee1 e : streamList) {
System.out.println(e.toString());
}
System.out.println("Streams low sal------------");
streamList.stream().filter(e -> e.totalSal < 20000).map(e -> {
e.totalSal += 5000;
return e;
}).forEach(System.out::println);
}
}
public class Employeee1 {
int empNo;
int basicSal;
int totalSal;
public Employeee1(int empNo, int basicSal) {
super();
this.empNo = empNo;
this.basicSal = basicSal;
}
public int getEmpNo() {
return empNo;
}
public void setEmpNo(int empNo) {
this.empNo = empNo;
}
public int getBasicSal() {
return basicSal;
}
public void setBasicSal(int basicSal) {
this.basicSal = basicSal;
}
public int getTotalSal() {
return totalSal;
}
public void setTotalSal(int totalSal) {
this.totalSal = totalSal;
}
@Override
public String toString() {
return "Employeee1 [empNo=" + empNo + ", basicSal=" + basicSal + ", totalSal=" + totalSal + "]";
}
}
int empNo;
int basicSal;
int totalSal;
public Employeee1(int empNo, int basicSal) {
super();
this.empNo = empNo;
this.basicSal = basicSal;
}
public int getEmpNo() {
return empNo;
}
public void setEmpNo(int empNo) {
this.empNo = empNo;
}
public int getBasicSal() {
return basicSal;
}
public void setBasicSal(int basicSal) {
this.basicSal = basicSal;
}
public int getTotalSal() {
return totalSal;
}
public void setTotalSal(int totalSal) {
this.totalSal = totalSal;
}
@Override
public String toString() {
return "Employeee1 [empNo=" + empNo + ", basicSal=" + basicSal + ", totalSal=" + totalSal + "]";
}
}
import java.util.*;
public class TestStream {
public static void main(String[] args) {
List<Integer> iList = Arrays.asList(2,3,4,5,6,7,8);
iList.stream().filter(i -> i%2==0).map(i -> i*i).filter(i->i<50).forEach(System.out::println);
}
}
public class TestStream {
public static void main(String[] args) {
List<Integer> iList = Arrays.asList(2,3,4,5,6,7,8);
iList.stream().filter(i -> i%2==0).map(i -> i*i).filter(i->i<50).forEach(System.out::println);
}
}
Kindly check files in channel for PDFs , handwritten notes , docs n many more concepts if still having issues ping us @stockkida
Yahoo is hiring for Software Developer Intern
Role : SDE intern
Experience: Freshers
Passout year: 2022/2023/2024
Location : India (Work From Home)
Qualification: B.Tech/BE/BSc/BCA/BS
Salary: 50k to 70k per month
Apply Now: https://ouryahoo.wd5.myworkdayjobs.com/en-US/careers/job/India---Remote/Software-Developer-Intern_JR0021340
Role : SDE intern
Experience: Freshers
Passout year: 2022/2023/2024
Location : India (Work From Home)
Qualification: B.Tech/BE/BSc/BCA/BS
Salary: 50k to 70k per month
Apply Now: https://ouryahoo.wd5.myworkdayjobs.com/en-US/careers/job/India---Remote/Software-Developer-Intern_JR0021340
You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of size m.
You have to perform m independent queries on the tree where in the ith query you do the following:
Remove the subtree rooted at the node with the value queries[i] from the tree. It is guaranteed that queries[i] will not be equal to the value of the root.
Return an array answer of size m where answer[i] is the height of the tree after performing the ith query.
You have to perform m independent queries on the tree where in the ith query you do the following:
Remove the subtree rooted at the node with the value queries[i] from the tree. It is guaranteed that queries[i] will not be equal to the value of the root.
Return an array answer of size m where answer[i] is the height of the tree after performing the ith query.
Input: root = [5,8,9,2,1,3,7,4,6], queries = [3,2,4,8]
Output: [3,2,3,2]
Explanation: We have the following queries:
- Removing the subtree rooted at node with value 3. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 4).
- Removing the subtree rooted at node with value 2. The height of the tree becomes 2 (The path 5 -> 8 -> 1).
- Removing the subtree rooted at node with value 4. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 6).
- Removing the subtree rooted at node with value 8. The height of the tree becomes 2 (The path 5 -> 9 -> 3).
Output: [3,2,3,2]
Explanation: We have the following queries:
- Removing the subtree rooted at node with value 3. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 4).
- Removing the subtree rooted at node with value 2. The height of the tree becomes 2 (The path 5 -> 8 -> 1).
- Removing the subtree rooted at node with value 4. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 6).
- Removing the subtree rooted at node with value 8. The height of the tree becomes 2 (The path 5 -> 9 -> 3).