Code Monkey home page Code Monkey logo

Comments (18)

callqh avatar callqh commented on May 30, 2024

胡歌:https://leetcode-cn.com/u/callmew/
练习内容:每日一题
累计总数:236
今日增加:1

from leetcoderank.

FuYouJ avatar FuYouJ commented on May 30, 2024

付有杰:https://leetcode-cn.com/u/fuyoujie2020/
练习内容:归并排序

package acwing.sort;
import java.io.IOException;
import java.util.Scanner;

/**
 * @author FuYouJ
 * @date 2021/12/29
 * @desc
 */
public class MergeSort {
    static int[] arr;
    static int[] temp;
    public static void main(String[] args) throws IOException {
        Scanner in =  new Scanner(System.in);
        int n = in.nextInt();
        arr = new int[n];
        temp = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        mergeSort(arr, 0, n - 1);
        for (int i = 0; i < n; i++){
            System.out.print(arr[i] + " ");
        }
    }

    private static void mergeSort(final int[] arr) {
        mergeSort(arr,0,arr.length-1);
    }
    private static void mergeSort(final int[] arr, int l, int r){
        if (l >= r){
            return;
        }
        int mid = l + r >> 1;
        mergeSort(arr,l,mid);
        mergeSort(arr,mid + 1,r);
        int k = 0, i = l, j = mid + 1;
        while (i<= mid && j <= r){
            if (arr[i] <= arr[j]){
                temp[k++] = arr[i++];
            }else {
                temp[k++] = arr[j++];
            }
        }
        while (i <= mid){
            temp[k++] = arr[i++];
        }
        while (j <= r){
            temp[k++] = arr[j++];
        }
        k = 0;
        for (int index = l; index <= r ; index++) {
            arr[index] = temp[k++];
        }
    }
}

from leetcoderank.

zoucq avatar zoucq commented on May 30, 2024

zcq: https://leetcode-cn.com/u/zou-chang-qing/
练习内容:二叉树
累计总数:138
今日增加:1

from leetcoderank.

yahaha-rf avatar yahaha-rf commented on May 30, 2024

走地鸡: https://leetcode-cn.com/u/xuezhichao19970719/
练习内容:每日一题
累计总数:358
今日增加:1

直接treemap 最简单

from leetcoderank.

aflylong avatar aflylong commented on May 30, 2024

阿龙:https://leetcode-cn.com/u/a-long-k/
练习内容:字符串
累计总数:111
今日增加:1

from leetcoderank.

YmCoke avatar YmCoke commented on May 30, 2024

可乐:https://leetcode-cn.com/u/coke_yuemian/
练习内容:每日一题
累计总数:812
今日增加:1

from leetcoderank.

zxh008 avatar zxh008 commented on May 30, 2024

半橙汁 https://leetcode-cn.com/u/ban-cheng-zhi/
练习内容:2114. 句子中的最多单词数
累计总数:50
今日增加:1

from leetcoderank.

MyEnglandGirl avatar MyEnglandGirl commented on May 30, 2024

游子:https://leetcode-cn.com/u/myenglandgirl/
练习内容:字符串
累计总数:77
今日增加:1

from leetcoderank.

xingorg1 avatar xingorg1 commented on May 30, 2024

小石头:https://leetcode-cn.com/u/xingorg1/
练习内容:一手混子
累计总数:120
今日增加:1

from leetcoderank.

EastStarCrow avatar EastStarCrow commented on May 30, 2024

柏仔 https://leetcode-cn.com/u/gu-yao-c/
练习内容:验证二叉搜索树
累计总数:53
今日增加:1

from leetcoderank.

LeXinFang avatar LeXinFang commented on May 30, 2024

帅土豆 https://leetcode-cn.com/u/boring-karektx/
练习内容:有效的异位词
累计总数:71
今日增加:1

from leetcoderank.

yantyt2022 avatar yantyt2022 commented on May 30, 2024

来一打可爱多 https://leetcode-cn.com/u/laiyidakeaiduo/
练习内容:69. Sqrt(x)[补卡]
累计总数:54
今日增加:1

from leetcoderank.

1473972376 avatar 1473972376 commented on May 30, 2024

https://leetcode-cn.com/u/lin-h9/
练习内容:有效的括号
累计总数:16
今日增加:1

from leetcoderank.

hhyaya avatar hhyaya commented on May 30, 2024

小亚:https://leetcode-cn.com/u/hyl-6s/
练习内容:见2号补题
累计总数:12
增加:4
补30号-2号

from leetcoderank.

DevWizardFeng avatar DevWizardFeng commented on May 30, 2024

Rick:https://leetcode-cn.com/u/inspiring-sinoussi1ht/
练习内容:三数之和
累计总数:128
今日增加:1
补卡

from leetcoderank.

hw1240230669 avatar hw1240230669 commented on May 30, 2024

陈伟霆:https://leetcode-cn.com/u/will-6f/
练习内容:将一维数组转变成二维数组
累计总数:47
今日增加:1

from leetcoderank.

1576464141 avatar 1576464141 commented on May 30, 2024

穷奇 https://leetcode-cn.com/u/qiong-qi-z/
练习内容:实现 strStr()
累计总数:18
今日增加:1

from leetcoderank.

shulandmimi avatar shulandmimi commented on May 30, 2024

shulandmimi:https://leetcode-cn.com/u/shulandmimi/
练习内容:167. 两数之和 II - 输入有序数组
累计总数:101
今日增加:1

from leetcoderank.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.