homework

Convert VB.NET code to C#

Hi people, I have three projects written with VB.NET (2005) and have to convert them to C# code. (I know that i don't need to convert codes of .net languages at all). I have no time to rewrite them, need a tool or script to convert. Note: they are console applications. ...

What is order notation f(n)=O(g(n))?

Two questions: Question 1: Under what circumstances would O(f(n)) = O(k·f(n)) be the most appropriate form of time-complexity analysis? Question 2: Working from mathematical definition of O notation, how to show that O(f(n)) = O(k·f(n)), for positive constant k? My view: For the first one I think it is average case and worst case form...

what is average case analysis?

Hello again guys, question 1: why is average case analysis more difficult to carry out than the worst case analysis. got to think of alteast 4 points, thought of 1, am i right? answer: Algorithm exist for which no such analysis has been possible question 2: what is elementary operation in terms of time measure? and why is time-demand...

What is the problem with this code? How to solve it? (fork)

What is the problem with this code? How to solve it? Parent processes goto in if or child process? first code produce zombie process or second code or both or non ? #include <signal.h> #include <sys/wait.h> main() { for (;;) { if (!fork()) { exit(0); } sleep(1); } } what about this code : #include <signal.h> #...

class header+ implementation

what am I doing wrong here? I keep on getting a compilation error when I try to run this in codelab (turings craft) Instructions: Write the implementation (.cpp file) of the GasTank class of the previous exercise. The full specification of the class is: A data member named amount of type double. A constructor that no parameters. Th...

AccessControlException: access denied - caller function failed to load properties file

Hi all: I am having a jar archive environment which is gonna call my class in a folder like this: java -jar "emarket.jar" ../tournament 100 My compiled class is deployed into the ../tournament folder, this command runs well. After I changed my code to load a properties file, it gets the following exception message: Exception in thr...

Nth largest element in a binary search tree

How to find the Nth largest node in a BST? Do I keep a count variable while doing In Order Traversal of a BST? Return the element when the count = N??? ...

Are these tables respect the 3NF Database Normalization?

AUTHOR table Author_ID, PK First_Name Last_Name TITLES table TITLE_ID, PK NAME Author_ID, FK DOMAIN table DOMAIN_ID, PK NAME TITLE_ID, FK READERS table READER_ID, PK First_Name Last_Name ADDRESS CITY_ID, FK PHONE CITY table CITY_ID, PK NAME BORROWING table BORROWING_ID,pk READER_ID, fk TITLE_ID, fk DATE HISTORY ta...

Java: I want to print reverse of any String without using any predefine function?

how to print reverse of String "java is object orientated language" without using any predefine function like reverse() in java? any idea. ...

What would be the datastructure in following scenario? (Stack with maximum)

Please note that there is no limitation of memory. I need to insert int from 1 to 1000. I can do the each of the following operations in constant order of time: push():adds to the top pop():removes the top element getMax(): returns the max element Please suggest me appropriate datastructure. ...

How do I get the next token in a Cstring if I want to use it as an int? (c++)

My objective is to take directions from a user and eventually a text file to move a robot. The catch is that I must use Cstrings(such as char word[];) rather than the std::string and tokenize them for use. the code looks like this: void Navigator::manualDrive() { char uinput[1]; char delim[] = " "; char *token; cout ...

HCI - How to evaluate a device to the relation with these theories such as: "senses (Visual, Auditory, Haptic) and cognition (short term and long term memory)"?

How can to evaluate a computerized device or a software application in the HCI field to the relation with these theories such as: "Senses (Visual, Auditory, Haptic) and cognition (short term and long term memory)" and based on the context where the device is used? Any help or advice is appreciated. Thanks ...

Theory of Computation - Showing that a language is regular..

I'm reviewing some notes for my course on Theory of Computation and I'm a little bit stuck on showing the following statement and I was hoping somebody could help me out with an explanation :) Let A be a regular language. The language B = {ab | a exists in A and b does not exist in A*} Why is B a regular language? Some points are obvi...

Algorithm to find lenth of longest sequence of blanks in a given string

Looking for an algorithm to find the length of longest sequence of blanks in a given string examining as few characters as possible? Hint : Your program should become faster as the length of the sequence of blanks increases. I know the solution which is O(n).. But looking for more optimal solution ...

Is there a minimum spanning tree that does not contain the min/max weighted edge?

If we have an (arbitrary) connected undirected graph G, whose edges have distinct weights, does every MST of G contains the minimum weighted edge? is there an MST of G that does not contain the maximum weighted edge? Also, I'm more thankful if someone can give a hint of the key things one must keep in mind when dealing with such MST ...

Having problem with C++ file handling

Our lecturer has given us a task,I've attempted it and try every single effort I can,but I still struggle with one of the problem in it,here goes the question: The company you work at receives a monthly report in a text format. The report contains the following information. • Department Name • Head of Department Name • Month • Minimum ...

running multi threads in Java

My task is to simulate activity of couple of persons. Each of them has few activities to perform in some random time: fast (0-5s), medium(5-10s), slow(10-20s) and very slow(20-30s). Each person performs its task independently in the same time. At the beginning of new task I should print it's random time, start the task and then after tim...

C# Taking a element off each time (stack)

Greetings, Have a question considering a program that stimulates a stack.(not using any build in stack features or any such) stack2= 1 2 3 4 5 //single dimension array of 5 elements By calling up a method "pop" the stack should look like the following: Basically taking a element off each time the stack is being "called" up again. ...

Theory of computation - Using the pumping lemma for context free languages

I'm reviewing my notes for my course on theory of computation and I'm having trouble understanding how to complete a certain proof. Here is the question: A = {0^n 1^m 0^n | n>=1, m>=1} Prove that A is not regular. It's pretty obvious that the pumping lemma has to be used for this. So, we have |vy| >= 1 |vxy| <= p (p being the pu...

Optimally reducing maximum flow

Given a parameter k, I'm trying to delete k edges from a directed graph such that the maximum flow is reduced by as much as possible. The graph has a source s and a sink t, and the capacity of each edge is one. The graph may or may not contain cycles. My proposed solution would be to first perform a topological sorting on the graph, usi...