analysis

Worst case running time of this algorithm (how to justify)?

人走茶凉 提交于 2019-12-13 20:04:04
问题 I have an algorithm i'm trying to implement. I've been asked to determine a function that describes its worst case running time. As input, it takes an array of some length (lets call it n). Then what it does is as follows: if (n==0){ return 0;} else if(n==1){return A[0];} else{ return f(n-1)+f(n-2) } Sorry if I'm a tad sparse on the implementation details, but in a sense, its rather similar to something like the fibbanoci sequence. I'm thinking the worst case running time of this algorithm is

Beyond SOUNDEX & DIFFERENCE - SQL Server

烈酒焚心 提交于 2019-12-13 15:30:50
问题 I am using SOUNDEX & DIFFERENCE functions to do some analysis on the data present in the table. But this function fails at below type of data. The ITEM TYPE & ITEM SIZE are completely different. SELECT SOUNDEX('ITEM TYPE'), SOUNDEX('ITEM SIZE') op:- I350 I350 For DIFFERENCE op: - 4 I understand every analysis that human mind do can not be coded, still I would like to ask, are there exists any other functions in SQL Server that will help me out on my next level analysis ? 回答1: You can use an

writing an algorithm with Θ(nlogn)

拈花ヽ惹草 提交于 2019-12-13 12:34:10
问题 I have written this code for myself(it is not a home work) I want to know is this correct?thanks Algorithm with time Θ (nlogn), which can provide an array of n members to determine whether two elements in the array that are equal to x and then return those elements Algorithm Sum(arr,1,n): MergeSort(arr) For i<-- 1 to n m<-- BinarySearch(arr,arr[i],i+1,n) return m and arr[i] //end of the sum algorithm Algorithm BinarySearch(arr,arr[i],p,q) J<--[p+q/2] If (arr[j]+arr[i]=x) Return arr[j] else if

Time-compexity of algorithms

天大地大妈咪最大 提交于 2019-12-13 10:41:01
问题 Ok so I came across a question and I am confused about its answer. I have to find the time complexity of the algorithm. The algorithm says that I have an array of size n and on each element of the array 5 operations are to be performed. So I came up with the following answer that I have to perform 5*n operations in total on it right? so it's time complexity would be of the order n? 回答1: Yes. If the time required for each operation is constant. But also depends on what the operations are. 来源:

Methodologies for Requirement analysis - Database development [closed]

戏子无情 提交于 2019-12-13 10:39:42
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . In the database development process, Below are the two methodologies used for requirement analysis phase , 1) SDA - Structured data analysis 2) SSAD - Structured systems analysis and design method The specification documents created in requirement analysis phase are used as input to conceptual schema design

Algorithm running time

北慕城南 提交于 2019-12-13 09:55:08
问题 What would the running time be? I got O(n^2) `cin >> n; min = 2*n; max = (n+3)*10; for(int i=0; i<1000; i++) for(int j =0; j<n; j++) for(int k = min; k< max;k++) p = f+c+m ` 回答1: No matter what outer loop runs 1000 times..so the complexity ~ O(n^2) . [innermost runs 10n+30-2n = 8n+30 times and loop with variable j runs n times..] 回答2: The number of times p is computed is: 1000 * n * (max - min) = 1000 * n * ((n + 3)*10 - 2*n) = 1000 * n * (10*n + 30 - 2*n) = 1000 * n * (8*n + 30) = 8000 * n^2

Android: Finding fundamental frequency of audio input

独自空忆成欢 提交于 2019-12-13 08:20:00
问题 So, I've been trying for some time now to find the best solution to calculate the fundamental frequency of a sample captured using AudioRecord in real-time. I have looked around some examples around here on SO: This one, and this one are the questions that helped me the most, but I still did not understand fully how they would work for finding the fundamental frequency. So what I am looking for is a more detailed explanation of what do I need to do to find the fundamental frequency having a

R: How to pivot and count data.frame (ex: list of medical conditions and the number of patients with each)

夙愿已清 提交于 2019-12-13 05:53:40
问题 I'm trying to get better with dplyr and tidyr but I'm not used to "thinking in R". An example may be best. The table I've generated from my data in sql looks like this: ╔═══════════╦════════════╦═════╦════════╦══════════════╦══════════╦══════════════╗ ║ patientid ║ had_stroke ║ age ║ gender ║ hypertension ║ diabetes ║ estrogen HRT ║ ╠═══════════╬════════════╬═════╬════════╬══════════════╬══════════╬══════════════╣ ║ 934988 ║ 1 ║ 65 ║ M ║ 1 ║ 1 ║ 0 ║ ║ 94044 ║ 0 ║ 69 ║ F ║ 1 ║ 0 ║ 0 ║ ║ 689348

Project and software analysis - where to begin?

会有一股神秘感。 提交于 2019-12-13 04:08:38
问题 Recently i took project and software analysis lessons. At first i found the subject kinda boring but then i began to see the importance of them. Modeling is pretty important. My teacher showed us some basic diagrams: classes, use cases, sequence and statemachine. It was only 7 lessons and now i want to pursue further education on the subject. As a developer, i think it would improve my work. Where do i begin? Any books or web sites? I'm still pretty much a newbie at it so please, not too much

Power BI: How to scenario analysis, where the selector “looks up” the select value from slicer and gets values from that row

限于喜欢 提交于 2019-12-13 03:46:17
问题 I've followed multiple tutorials on scenario analysis and what if analysis in power BI. these examples are quite clear to me and I somewhat understand how they work. For example this (https://community.powerbi.com/t5/Community-Blog/Scenario-Analysis-What-Ifs-Tips-amp-Techniques-For-Power-BI/ba-p/559653). In this example they create a table that contains values for different scenarios 5% 10% 15% 20% etc. and the user of the report can select these. But what if instead of direct values I have