R

@roshan_waa

fibonacciGenerator

NodeJS
2 years ago
function fibonacciGenerator(n) { //Do NOT change any of the code above 👆 //Write your code here: let output = []; if (n === 1 || n === 0) { output = [0]; } else if (n === 2) { output = [0, 1];

swap of two number

Java
2 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { System.out.println("Hello world!"); int i = 4;

The Quest for Perfection

Java
3 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int test = sc.nextInt();

The Quest for Perfection

Java
3 years ago
import java.util.*; import java.lang.*; import java.io.*; import java.util.Scanner; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in);

Reverse Numberlocked := All of you know better how to reverse a given number! Reversed number

Java
3 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testCase = sc.nextInt

LinList

Java
3 years ago
import java.util.*; class Node { int data; Node next; Node(int x){ data = x; next = null; }

Code for BFS (Recursive)

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". // Method to calculate height of a tree int height(Node root) { if (root == null) return 0; int leftHeight = height(root.l

DFS

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // Method to print the tree in pre-order traversal void preOrderDFS(Node node) { if (node == null) return; // visit the parent node (parent of left & right children)

BT

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // class representing a node (element) in a tree class Node { int data; // value contained inside a node Node left, right; // left & right children of a node // constructor to s

Binery Tree Delete Operation

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". import java.util.*; //implement tree using linked list

Reverse Check

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static <T> void reverseStack(Stack<T> stack) { if (stack.isEmpty()) { return;

sum of Num

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { System.out.println("Enter a number "); try (Scanner sc = new Sc

Get Details

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { LinkedList<Student> studentList = new LinkedList<Student>(); St

Get Method Use

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { // ArrayList<Float> random = new ArrayList<Float>(); Linked

test1

Java
4 years ago
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; // Class name should be "Source", // otherwise solution won't be accepted public class Source { public static void main(String[] ar

Change The Value

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { double pi = 3.145714158; System.out.println(pi); // Casting double

Change The Value

Java
4 years ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { double pi = 3.145714158; System.out.println(pi); // Casting double