homework

How to mask DLL in .NET ?

Let's say I have a DLL that provides math calculus functions. To use it, I include the using Colhq.Math.Basic; namespace. How could I use it by adding a statement like using Blala.Functions.Math; ? So how could I use everything (methods, enums, etc.) from a DLL by using a different namespace ? Is there a one-shot way to wrap or mask a...

struct and rand()

I have a struct with an array of 100 int (b) and a variable of type int (a) I have a function that checks if the value of "a" is in the array and i have generated the array elements and the variable with random values. but it doesn't work can someone help me fix it? #include <stdio.h> #include <stdlib.h> #include <time.h> typedef str...

How to create a c/c++ tree script?

How to create a script to : compare two trees, in c/c++ in a non recursive mode? also, How to create a script in c/c++ to verify if a tree is binary, in a non recursive mode? thanks in advance. ...

How do you display a binary search tree?

I'm being asked to display a binary search tree in sorted order. The nodes of the tree contain strings. I'm not exactly sure what the best way is to attack this problem. Should I be traversing the tree and displaying as I go? Should I flatten the tree into an array and then use a sorting algorithm before I display? I'm not looking f...

inserting in a sorted linked list in Java

Hi stack overflow. I need to insert some objects contained in a Node class into a LinkedList class in a sorted over. The Node class looks like: public class Node { private Card val; private Node next; public Node(Card v) { val = v; next = null; } where card implements the Comparator interface. I'm trying to...

SQL Server 2005 Create Table with Column Default value range

Trying to finish up some homework and ran into a issue for creating tables. How do you declare a column default for a range of numbers. Its reads: "Column Building (default to 1 but can be 1-10)" I can't seem to find ...or know where to look for this information. CREATE TABLE tblDepartment ( Department_ID int NOT NULL IDENTITY, Departm...

Prolog homework problem?

the problem is ; we have a funtion take 3 argument, like; func ( [[0, 0, 0, 1, 0], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0]], (1, 1), X ) the first one is nested list, which is show 5x5 matrix and 1s means it is full, 0 means empty and, the second parameter (1,1) our starting point 1st row 1st column, the 3rd p...

Difference between master page and aspx page

pls tell about difference between master page and aspx page i need exact difference shortly, if u know pls, i refered so many website and books but i can't get it. ...

semantics in perl

i am new to perl and was asked to do a documentation on the semantics of perl.i did find some information but i cannot understand them.can some one explain it to me ion a simple way?a very simple explanation is enough.no need to go to deapth. explain how axiomatic,operatioonal and denotational semantics are implemented in perl thank you ...

How to solve this logical problem with Prolog?

That's my first question so please be tolerant. I've logical problem to write in prolog/CLP: "It is known only one character is telling the truth. Mr April says Mr May tells lies. Mr May says Mr June tells lies. Mr June says that both Mr April and Mr May tell lies. Write a program which determines who is telling the trut...

What is the complexity of the following method?

Hello, I'm still learning about complexity measurement using the Big O Notation, was wondering if I'm correct to say that following method's complexity is O(n*log4n), where the "4" is a subscript. public static void f(int n) { for (int i=n; i>0; i--) { int j = n; while (j>0) j = j/4; } } ...

writing depth first search in c

I'm trying to write depth first search in C. In the search instead of maintaing a set of all the reachable nodes I instead have to mark the isVisited field in Vertex as a 1 for visited. Here's my data structs and my algo attempt. struct Vertex { char label; int isVisited; int numNeighbors; struct Vertex** neighbors; }; ...

Can anyone would provide me an example of reference-based linked list?

I'm trying to create a reference based linked list anyone would be able to provide me an example of it?? ...

Big O Complexity of a method

I have this method: public static int what(String str, char start, char end) { int count=0; for(int i=0;i<str.length(); i++) { if(str.charAt(i) == start) { for(int j=i+1;j<str.length(); j++) { if(str.charAt(j) == end) count++; } } ...

Quick Big-O question

int a = 3; while (a <= n) a = a*a; My version is that its complexity is: Is there such a thing? ...

Data persistance with BufferedReader and PrintWriter?

I have this simple application with a couple of classes which are all related. There's one, the main one, for which there is only one instance of. I need to save save and load that using a text stream. My instructor requirement is BufferedReader to load the stream and PrintWriter to save it. But is this even possible? To persist a data ...

rule based file parsing

I need to parse a file line by line on given rules. Here is a requirement. file can have multiple lines with different data.. 01200344545143554145556524341232131 1120034454514355414555652434123213101200344545143554145556524341232131 2120034454514 and rules can be like this. if byte[0,1] == "0" then extract this line to /tmp/record...

How to find Unix system() function path in C

i am doing a project about shell, and i want the code that gives me the path the system() function uses. example, when i enter the command type dir the reply will be dir is external command (/bin/dir) this is what i reached, but its not working else if(strcmp(arg3[0],"type")==0) //if type command { if(strcmp(arg...

unit, integration and system tests for PHP applications

Hi, We were given an assignment to develop a prototype for a customer community. It was suggested PHP as the programming language. (but we're not supposed to actually code it, just a prototype with documentation is required) I'm wondering what are the best practices/ tools used in Unit testing, Integration Testing and System testing for...

Tricky Big-O complexity

public void foo (int n, int m) { int i = m; while (i > 100) i = i/3; for (int k=i ; k>=0; k--) { for (int j=1; j<n; j*=2) System.out.print(k + "\t" + j); System.out.println(); } } I figured the complexity would be O(logn). That is as a product of the inner loop, the outer loop -- ...