i m working with this program but dont know how to add counter in it in order to check running / execution time of program.please help me. and telll how and where to add code for this task?plz reply soon.
public class InsertionSort{
public static void main(String a[]){
int i;
int array[] = {12,9,4,99,120,1,3,10};
im working with this program for merge sort. i want to add a counter in it in order to check running / execution time ofd program. please help me. please reply soon.
public class mergeSort{
public static void main(String a[]){
int i;
int array[] = {12,9,4,99,120,1,3,10};
I am making a pipeline of several commands.
This is a part of my shell script.
-----------------------------------
array=(
"mkdir src"
"ls -l | grep tk_ > src/list"
)
len=${#array[*]}
i=0;
while [ $i -lt $len ]; do
echo ${array[$i]}
if !(${array[$i]}); then exit 1; fi;
let i++
Hi folks,
I am self-learning as I can
I have a script that has read a file into an array.
I can read out each line in the array with the code:
Code:
for INDEX in {0..$LENGTH} ## $LENGTH was determined at the read in
do
echo "${data[$INDEX]}"
done
What I need to do is test the first char of each line so I can branch out for processing.
In essence, the psudo-code look
Hi folks,
I am self-learning as I can
I have a script that has read a file into an array.
I can read out each line in the array with the code:
Code:
for INDEX in {0..$LENGTH} ## $LENGTH was determined at the read in
do
echo "${data[$INDEX]}"
done
What I need to do is test the first char of each line so I can branch out for processing.
In essence, the psudo-code loo
Hi!
Let's say I would like to convert "1", "2", "3" to "a", "b", "c" respectively.
Hello,
I need help in fetching data from a delimited file , into a 2D array.
Sample Input File:
"|" as delimiter
Code:
A|123|446pr;
B|46|hello89
krp;
C|78|ystp90
67;
D|ga|456;
Please be advised that ";" is the line separator (not "\n"). Could you please write an awk script to fetch this into a 2D array.
Output: array[0,1]=123
Thank You !
Im wanting to use execvp to run a command.
Hello All,
I have an Expect Script that ssh'es to a server and does some stuff.
In Expect there is a built-in Array Variable called "expect_out(buffer)" which contains all the output from the previous send command up until the expected output.
I want to pass the array "expect_out(buffer)" to a Procedure/Function I have.