Refactor Code Style (#4151)

This commit is contained in:
Saurabh Rahate
2023-04-15 13:55:54 +05:30
committed by GitHub
parent 1ce907625b
commit 1dc388653a
100 changed files with 293 additions and 319 deletions

View File

@ -3,7 +3,7 @@ package com.thealgorithms.datastructures.trees;
public class FenwickTree {
private int n;
private int fen_t[];
private int[] fen_t;
/* Constructor which takes the size of the array as a parameter */
public FenwickTree(int n) {

View File

@ -2,12 +2,12 @@ package com.thealgorithms.datastructures.trees;
public class SegmentTree {
private int seg_t[];
private int[] seg_t;
private int n;
private int arr[];
private int[] arr;
/* Constructor which takes the size of the array and the array as a parameter*/
public SegmentTree(int n, int arr[]) {
public SegmentTree(int n, int[] arr) {
this.n = n;
int x = (int) (Math.ceil(Math.log(n) / Math.log(2)));
int seg_size = 2 * (int) Math.pow(2, x) - 1;