analysis

about counting sort algorithm

会有一股神秘感。 提交于 2019-12-21 06:18:15
问题 I have read a counting sort algorithm which is like this: Counting Sort(A[1,..n]) //C[1,...k] is the temporary memory and k is the range of integers for i<-- 1 to k C[i]<-- 0 for j<-- 1 to n C[A[j]]<--C[A[j]]+1 for i<--2 to k C[i]<--C[i]+C[i-1] for j<--n downto 1 B[C[A[j]]]<--A[j] C[A[j]]<--C[A[j]]-1 I want to know that if I change the last for to this: for j<--1 to n ,the algorithm will be correct too???(is there any way to show that with this "for" the algorithm will be correct??? ) also in

Lock analyser for Java application

余生颓废 提交于 2019-12-21 05:27:10
问题 I have two versions of a Java application which use different concurrency logic. I want to analyze and compare their performance (such amount of time a lock was acquired etc.) so that I can use the better one. I found out a tool IBM Lock Analyzer for Java but it is neither open source nor JDK version independent. It requires an IBM®-supplied Java™ SDK or JRE. Another tool also from IBM is Multicore Software Development Kit and has the following problem "The testing and analysis tool of MSDK

Web Server Log Analysis Tool

[亡魂溺海] 提交于 2019-12-21 00:14:15
问题 Any suggestions for an accurate Web Log analysis tool to generate reports on the IIS logs? We used WebTrends, but I don't feel it was accurate. 回答1: To analyze weblogs, I don't think you can go wrong with Analog: http://www.analog.cx/ If you are analyzing your own logs, which are often huge files, you will want the fastest analyzer you can find. Analog is fast. You'll want one that's been around awhile and is still supported. Analog just celebrated its 10'th birthday. Analog claims to be the

Generate Call-Tree from cscope database

亡梦爱人 提交于 2019-12-20 18:32:03
问题 I want to generate Full and Partially Call Trees from cscope database of c and c++ projects in Linux. The project is rather large, so it can be not easy to work with the full call tree of project, so I want to limit call tree generation with grep-like filter of function names. And also I want to be able to build "called by" and "called from" sub-trees from any point. So tool must be interactive and easy to patch. PS: I want use cscope database, because it is already used in project and

Meaning of lg * N in Algorithmic Analysis

这一生的挚爱 提交于 2019-12-20 17:18:12
问题 I'm currently reading about algorithmic analysis and I read that a certain algorithm (weighted quick union with path compression) is of order N + M lg * N. Apparently though this is linear because lg * N is a constant in this universe. What mathematical operation is being referred to here. I am unfamiliar with the notation lg * N. 回答1: The answers given here so far are wrong. lg* n (read "log star") is the iterated logarithm. It is defined as recursively as 0 if n <= 1 lg* n = 1 + lg*(lg n)

Algorithm to find high/low numbers with at most 1.5n comparisons

倖福魔咒の 提交于 2019-12-20 12:40:46
问题 I've been thinking about this homework question for a bit now. Given an number array of size n, design an algorithm that will find the high and and low values with at most 1.5n comparisons. My first try was int high=0 int low= Number.MaxValue //problem statement is unclear on what type of number to use Number numList[0 . . n] //number array, assuming unsorted for (i=0, i < n, i++) { if (numList[i] > high) high = numList[i] else if (numList[i] < low) low = numList[i] } My problem is each

How would you go about finding the complexity of this algorithm?

廉价感情. 提交于 2019-12-20 04:22:27
问题 function alg1(n) 1 a=0 2 for o=1 to n do 3 for t=1 to o do 4 for k=t to o+t do 5 a=a+1 6 return(a) If anyone could guide me to how you would find the worst-case here, and how to get the output a of alg1 as a function of n, I would be very grateful. Thanks! 回答1: We can compute the exact number of increments this code executes. First, let's replace for k=t to o+t do with for k=1 to o+1 do After this change, two inner loops looks like this for t=1 to o do for k=1 to o+1 do The number of

Bisection method (Numerical analysis)

主宰稳场 提交于 2019-12-20 04:13:38
问题 How many recursions are made before every single root is found? Also, which ones are the roots? Here's my code: e=0.000001; f1=@(x) 14.*x.*exp(x-2)-12.*exp(x-2)-7.*x.^3+20.*x.^2-26.*x+12; a=0; c=3; while abs(c-a)>e b=(c+a)/2; if f1(a)*f1(b)<0 c=b; else a=b; end disp(b); end 回答1: Bisection works by taking endpoints of some initial interval [a,b] and finding which half of the interval must contain the root (it evaluates the midpoint, and identifies which half has the sign change). Then

Frequency Analysis in Python

主宰稳场 提交于 2019-12-18 11:59:06
问题 I'm trying to use Python to retrieve the dominant frequencies of a live audio input. For the moment I am experimenting using the audio stream my Laptop's built in microphone, but when testing the following code, I am getting very poor results. # Read from Mic Input and find the freq's import pyaudio import numpy as np import bge import wave chunk = 2048 # use a Blackman window window = np.blackman(chunk) # open stream FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 1920 p = pyaudio.PyAudio()

Audio analysis to detect human voice, gender, age and emotion — any prior open-source work done?

吃可爱长大的小学妹 提交于 2019-12-18 10:08:00
问题 Is there prior open-source work done in the field of 'Audio analysis' to detect human-voice (say in spite of some background noise), determine speaker's gender, possibly determine no. of speakers, age of speaker(s), and the emotion of speakers? My hunch is that the speech recognition software like CMU Sphinx could be a good place to start, but if there's something better, it'd be great. 回答1: I'm a graduate student doing speech recognition research. These are open research problems, and,