Java Sort algorithm optimization--shell sort "warm and know new"

/** * * @author Fly/public class Shellsort {public int[] Shellsort (int[] a) {int size = A.length; for (int step = SIZE/2, step > 0, Step/= 2) {for (int i = 0; i I && a[k-step] > Temp. K-= Step) {A[k] = A[k-step]; }

Array definition of shell

Original address: http://blog.chinaunix.net/u/21908/showart.php?id=1420565 reference * Learn Bash Shell 3rd edition 6.4. Arrays You can also use array variables in Bash, which are assigned two types of values:(1) name = (value1 ... valuen) at this

Java calls the shell command and gets execution results

Using the process and runtime two classes, the return value is obtained by the getInputStream () method of the Process class[Plain] View plain copy package ark;      import java.io.bufferedreader;   Import  java.io.IOException;  

How to determine if a file is empty in the shell

When writing scripts in Linux, there is always the need to determine whether the existence of files, the contents of the file is empty and so on, and these operations can be implemented with the test instructions, through the man test instructions

Various judgments of shell scripts

1. String judgment STR1 = str2 When two strings have the same content, the length is true STR1!= str2 is true when strings str1 and str2 are unequal -N str1 True when the length of the string is greater than 0 (string not empty) -Z str1 True when

Ufida + peanut Shell to achieve different network environment exchange visits

Well, it's purely memo-type. 1. Install peanut shell and register a free domain name. 2. The network environment determines the future operation ① If your machine is connected directly to the extranet, the router is not used, so you can use it. ②

Write daemon with shell script

Recently in doing the server, because it is all-weather operation, the server is not said to be absolutely stable, never crash never crashed anything, so even if the downtime does not matter, the key is to be able to start in time, can not affect

Shell scripts automatically generate crontab

1. Sometimes operation and maintenance requirements automatically generated  Cronab  task scheduling, the implementation of the corresponding service name management;  #!/bin/bash#athor check crontab crontab_ Add () {cron_path= "$" cat >/etc/cron.d/$

Numerical operations of Shell programming

Declare-r variable name = variable 1+ variable 2[Email protected] test]# aa=11[Email protected] test]# bb=22[Email protected] test]# declare-i cc= $aa + $bb[Email protected] test]# echo $CC33[[email protected] test]# dd=$ (expr $aa + $bb) Note:

Linux Shell Example (ii)

First, regular expressionA, the basic regular expression Meta character Description . Match any single character * Match any of its preceding characters any time .*

Linux Shell Learning

Var=value//This is a value assignment.Note that there is no space between the variable and the value, otherwise it will be considered equivalent judgment, such as [var = valu E]//equivalent judgment, the space is particularly important!!!#!/bin/SHCD

Shell Programming in CentOS

1.shell is a batch program, similar to the Windows BAT file2. When writing the shell, the first line should be #! /bin/bash begins Execute the file using the bash shell.3. Use the # comment (preferably note the function of the shell script in case

Shell programming file testing and if multi-branch statements

File Test usage: -e :判断文件是否存在,如果不存在返回的状态为假 -f :判断文件是否为普通文件 -d :判断是否为目录 -x :判断当前用户是否可执行此文件 -w :判断当前用户是否可写此文件 -r :判断当前用户是否可读此文件 如 [ -e /etc/inittab ]If multi-branch statement if 条件一 ;then 执行语句 elif 条件二 ;then

Shell Change Programming One

A 1.shell programming language is a dynamic language (a weakly typed language) that interprets side execution at run time, does not need to be declared before it is used, is declared in use, and does not even differentiate between variable types,

Process Control keywords in the shell

If...elseif [$1x = = "AB" x]; Then echo ' You had enter AB ' elif [$1x = = ' CD ' x]; then echo ' You had enter CD ' Else echo ' You had enter UNEXPE CTED word "fi  Case...esacA switch case similar to another language, however, here is a

Shell Script-Introduction

Shell and shell scripting differencesShell: Refers to an application that provides an interface through which the operating system kernel services can beShell script: A script written for the shellExecution of Shell scriptsPass./execute instead of

Shell Error Output redirection

Turn from: Https://www.cnblogs.com/vijayfly/p/6234575.htmlshell redirect standard error output to a different locationThe following forms of command invocation can often be found in some scripts, especially when Crontab is called:/tmp/test.sh

Shell writing character Menu Management-8

8th Shell Programming Character Menu ManagementI. Shell function definitionFunction menu () {Echo ' This is a func!! ';}Two. Shell functions useMenuThree. How to use the Cat command HeredocCat

MacOS Shell Programming Notes

2. MacOS does not support ll (need to use LS-L implementation), in fact ll under Linux is ls-l shortcut keys.LS Displays the file in the current directory.LS-L Displays the file details in the current directory.#以下命令均不包含 ".", "..." Directories, and

Initial construction of Jumpserver with Shell

#!/usr/bin/bash#jumpserverTrap "" HUP INT ouit TSTPClearWhile:DoWebserver=192.168.117.101mysql=192.168.117.102Cat 1.WEB2.MYSQLEofRead-p "input number:" numCase ' $num ' in1) SSH [email protected] $webserver;;2) SSH [email protected] $mysql;;*) echo "

Total Pages: 541 1 .... 514 515 516 517 518 .... 541 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.