anyone can give me an advice for improving this piece code, it give me a complexity of score of 10. There is something telling in back of my mind that it can be improve, but this is the best i can do. arggg public override bool Validate(Control control, object value) { if (value == null && !_IsAllowNull) { ErrorText = "Please provided valid number without a decimal point."; return false; } else { if (value.ToString().Contains(".")) { ErrorText = "Decimal value is not allowed"; return false; } else { if (!value.IsNumber()) { ErrorText = "Please provided valid number without a decimal …

Member Avatar
Member Avatar
+0 forum 1

I'm studying for a test and appreciate your help. How to calculate the running time (T(n)) of the following segment (written in Pascal): k := 0; m := n; while m <= n do begin k := k + 1; m := k * k; end; for i := 1 to k do for j := i to k do begin s := s + m; m := m - 1; end;

Member Avatar
Member Avatar
+0 forum 1

package JavaApplication42; import java.io.*; import java.io.IOException; import java.util.*; import java.io.BufferedReader; public class DPmodification { public static void main(String[] args) { BufferedReader br = null; int n, c, d,k, swap,i=0,j=0,no_of_selected_item=0; int numItems; int numTransactions; double minSup; String configFile = "F:\\New Folder\\configtrial.txt"; try{ FileInputStream file_in = new FileInputStream(configFile); BufferedReader data_in = new BufferedReader(new InputStreamReader(file_in)); //number of items numItems = Integer.valueOf(data_in.readLine()).intValue(); boolean[] skiplist=new boolean[numItems]; //number of transactions numTransactions = Integer.valueOf(data_in.readLine()).intValue(); //minsup minSup = (Double.valueOf(data_in.readLine()).doubleValue()); int[] length=new int[numTransactions]; int[] sum=new int[numItems]; int[][] m=new int[numTransactions][numItems]; String[] line=new String[numTransactions]; //output config info to the user System.out.print("\nInput configuration: " + numItems + " items, " + numTransactions …

Member Avatar
Member Avatar
+0 forum 1

So i don't really understand how I will calculate the time complexity for my code, I've had a hard time with it and I would really need some help. the exponent is N all the time. So how will i find the time complexity in N-time(bits).. for(int i = 0; i < powerup(2, exponent); i++) { candenc = KEYsubsetsum(candidate, T); m.insert(pair<Key, Key>(candenc, candidate)); candidate++; } ckey = candidate; do { candenc = KEYsubsetsum(candidate, T); if(mkey.find(encrypted-candenc) -> first + candenc == encrypted) { auto range = mkey.equal_range(encrypted-candenc); for(multimap<Key,Key>::iterator it=range.first; it!=range.second; ++it) cout << candidate + it->second << endl; } candidate = …

Member Avatar
Member Avatar
+0 forum 2

At the moment I am trying to decide which book to buy, there are many that I think would be very interesting, but some are most likely beyond me. The books in my list, along with my thoughts on them are: Concrete Mathematics (I believe this is probably too advanced for me at the moment, however I am revising mathematics and will want to pick this up in a few months) The art of computer programming volumes 1-4 (I have read many times that one should be familiar with the concepts in Concrete Mathematics before attempting to consume this book, …

Member Avatar
Member Avatar
+0 forum 13

GPO Problem So I’m having an issue configuring a password complexity group policy in my company’s network environment and I’m hoping someone with some solid experience with GPOs can help me out. We came in a while ago as salary workers to replace an out sourced IT department. I’m guessing that when they deployed these servers they never instituted a password complexity above what come’s default with server 2008. The end users are obviously using terribly unsecure passwords and this needs to change. The problem now is that it needs to be done very carefully since the company has grown …

Member Avatar
Member Avatar
+0 forum 4

Hi everyone, so I'm developing this app for android, I'm using "Android Studio" to code it and it's layout, but there's the thing, I can't seem to make the layout as I want, like the buttons are too huge or they aren't in the correct position and they're always messed up in different resolutions. What I'm asking is (since I can't build layouts) is there any easier way to do it or how to do it better with Android Studio? Thanks in advance, Daniel Moreira.

Member Avatar
Member Avatar
+0 forum 4

# Need your help! - Masters thesis / research paper # ## Hi there, ## within the final stage of my masters thesis I need to conduct a survey concerning "Advertising Appeal for Corporate Websites". I would appreciate your participation in my online survey/questionnaire. The reason for this survey is to investigate how complex a website has to be to be most attractive to a customer/user. It would be very nice if you attend to this survey! ## Please, just follow the link down below: ## http://mls.wiwi.tu-dresden.de/websites Of course your data will be taken very confidential and no inferences will …

Member Avatar
Member Avatar
+0 forum 3

int sum=0; for(i1=0,i1<m,i++){ for(i2=0,i2<m,i++){ for(i3=0,i3<m,i++){ ... ... ... for(im=0,im<m,i++){ sum += a[i1][i2][i3]...[im]; } } } } What is the time complexity of the above code? btw, I always having problems related to time complexity, do you guys got some good article on it? especially about the step count and loops and the growth rate of big-oh

Member Avatar
Member Avatar
+0 forum 1

Time complexity of the expression T(n)=3T(n/2)+Ɵ(n)? Please solve..

Member Avatar
Member Avatar
+0 forum 1

What is complexity to insert, delete, and search in both sorted and unsorted linked list (single, double.. doesn't matter in general) ?

Member Avatar
Member Avatar
+0 forum 1

I am given the amount of data and the time used. It asks for the time complexity. It is in a Big-O packet Below is the first problem given Algorithm A Data Time 1000 .003 2000 .012 4000 .048 8000 .192 Please explain how to get the time complexity. Thanks!

Member Avatar
Member Avatar
+0 forum 7

Hello all! First time poster here and I'm looking for a little help figuring out the time complexity of this program. int y; void p(int x) { x = y - 1; y += x; cout << x << " " << y << endl; if (x<3) p(x); cout << x << " " << y << endl; } void main(void) { int x; x = 0; y = 2; p(x); cout << x << " " << y << endl; } Thanks for any help you can give me!

Member Avatar
Member Avatar
+0 forum 2

Please can you help me to calc the complexity of this algorithm it may looks easy but i am new to all that int f=1; int x=2; for (int i = 1; i <= n; i*=2) for (int j = 1; j <= i * i; j++) if (j % i == 0) for (int k = 1; k <= j*i; k++) f=x*f; thanks in advance

Member Avatar
Member Avatar
+0 forum 5

Hello Everyone , I Try many Way,But I'm Unable to find out Cyclomatic Complexity of below C Code i = 0; while (i<n-1) do j = i + 1; while (j<n) do if A[i]<A[j] then swap(A[i], A[j]); end do; i=i+1; end do; Please Help Me out !!!

Member Avatar
Member Avatar
+0 forum 1

Hi, I am trying to create a binary tree from a string read from a file. The string contains information that tells which is the new left and right nodes, and the node which new these nodes are to be added (assuming there is a root node in the tree already). To find the node of where the 2 new nodes should be added, I used preorder tree traversal: [CODE]public void iterativePreorder(Node root) { Stack nodes = new Stack(); nodes.push(root); Node currentNode; while (!nodes.isEmpty()) { currentNode = nodes.pop(); Node right = currentNode.right(); if (right != null) { nodes.push(right); } Node …

Member Avatar
Member Avatar
+0 forum 1

how you would compute/denote the time complexity of two loops based on different variables? I understand how to compute the time complexity for a simple loop PseduoCode while X<N { while Y<M { Z++ } X++ } one loop occurs N times - time complexity O(N) the other loop occurs M - time complexity 0(M) M- happens to be a unknown function of N would the time complexity O(MN)? but In big O notation you are to drop all excess variables in which case time complexity would be O(N)? or neither? please help

Member Avatar
Member Avatar
+0 forum 5

Assume that we have a mergesort algorithm which takes 2 series as an input and returns 1 after the merge each time. So that if we want to count say memory blocks we would need 2 blocks for the input and 1 for the output accordingly, total size of 3 blocks (3B). My question is whether this algorithm could run if the memory size is 2B + O(1)?

Member Avatar
Member Avatar
+0 forum 3

I see that there are many questions here regarding complexity analysis, specifically regarding the Big-O notation of algorithms. I will attempt to shed some light on the subject. I will start with an introduction, after which I will go over some common complexities and last we will solve a few simple examples for practice. [U][B]1. Introduction[/B][/U] When looking at the Algorithm, we want to know its order of growth regarding the input size given to it. Consider two simple algorithms that sort an array of [TEX]n[/TEX] cells. The first algorithm is doing [TEX]n[/TEX] operations in order to complete the sort, …

Member Avatar
Member Avatar
+13 forum 11

Hi, I wanted to know the big Oh notation for this operation in Dynamic Array and LinkedList. I have answered the question but I am not sure if I really know how to determine the complexity. Please give me feedback of what I've done. Operation: Construct empty list : DA->O(1) list->O(1) --> both constant time operation? Size of the list : DA->O(1)-> constant time List->O(N)-> linear? isEmpty : DA->O(N)-> linear List->O(1)-> constant time? Clear : DA->O(N)-> linear List->O(1)-> constant time? Add item to start of the list : DA->O(N)->linear List->O(1)-> constant time? Locate item(contains,indexOf) : DA->O(1)-> constant time List->O(N)->linear? Add …

Member Avatar
+0 forum 0

I've got an algorithm that at most does 1 operation for the first time a loop is run, 2 for the second, 3 for the third up to n for the nth. Essentially the sum of all numbers 1 to n is the worst case running time. or [TEX]\frac{n*(n+1)}{2}[/TEX] I can't seem to figure out how to translate this to theta notation though. I think it is just [TEX]\theta(cn)[/TEX] is that correct? If not, why? Thanks, Joe

Member Avatar
Member Avatar
+0 forum 4

I am trying to determine the time complexity (and space complexity if anyone would like to have a go at it) of a sort function i implemented with a custom comparator. it is the sort function from the STL <algorithm>. First off, I am using Visual C++, so I am assuming it uses the standard C++ sort, which from what I have read on the web has an average complexity of N*log(N) and a worst case of N^2. Now, here is the implementation: [CODE] bool by_length (const string& s1, const string& s2) { if ( s1.length() == s2.length() ) return …

Member Avatar
Member Avatar
+0 forum 3

So here's the question: Suppose as min heap uses parent pointers such that each node contains a pointer to its parent and the root has a null pointer. Given a pointer to the node, which isn't the root of the tree, containing the max key in the heap, what is the complexity for deletion? The answer is O(1) but this doesn't make sense to me. Because heaps are always balanced you can't replace the deleted node with an adjacent node you have to scale the length of the tree O(log N) to find the last entered node in the tree, …

Member Avatar
Member Avatar
+0 forum 4

Hi, Is there anyone who know which complexity these functions are? I mean O(n), O(n^2), O(n^3), n log(n) or log(n) 1. --------------------------------------------- [CODE]void bogosort_array(double a[], int length) { do shuffle_array(a, length); while (! is_array_sorted(a, length)); }[/CODE] 2. --------------------------------------------- [CODE]void reverse_string(char* s) { int n = strlen(s); for (int i = 0; i < n / 2; ++i) { char temp = s[i]; s[i] = s[n - i - 1]; s[n - i - 1] = temp; } } [/CODE] 3. ------------------------------------------------------------- [CODE]double arrays_are_equal(double a[], double b[], int length) { for (int i = 0; i < length; ++i) { if …

Member Avatar
Member Avatar
+0 forum 2

For homework, we have to find the time complexity class of certain algorithms and explain why it has that certain complexity class. So, I have a couple of questions: - Why is the first running time always so much longer than the ones after? (setting up the application or something??) - What is the complexity class of an algorithm that draws a square of side length n, like this one: c.drawRect(0,0,n,n); why is it that way? - What is the complexity class of an algorithm that draws a circle of diameter n, like this: c.drawOval(0, 0, n, n); why is …

Member Avatar
Member Avatar
+0 forum 3

What language is the most difficult to compile and why ? (except natural ones)

Member Avatar
Member Avatar
+0 forum 1

The End.