|
Where can I find a good link for all the tricky questions asked on interviews on Programming??
|
|
|
|
|
|
|
Can we replace recursion by looping for example using a for loop or a while loop?
|
|
|
|
|
Yes.
Complexity increase.
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
You may don`t use loops at all roo. There are some languages (eg. Erlang), where u dont have any loops, just a recursion.
So its definitely possible, but weird, complex and nasty
|
|
|
|
|
You're basically asking if it's possible to put corners back on the wheel. The answer is yes, but the correct question is why would you want to? Recursion only simplifies code, maintenence, readability, processing, debuging, performance, stability and reliability.
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
What's the best complexity of an Algorithm and what's the worst?
What do we mean by Polynomial Algorithms..(if that actually exists)?
|
|
|
|
|
Hi Nada,
the best complexity of an algorithm that can be achieved is O(1). This means that an algorithm needs constant time, and is independent from its input. The best complexity of an algorithm depends on what you want to compute, for example the best complexity for an input-dependent sorting algorithm is O(n*log(n)), there is a really theoritical prove of it.
Hmm, and the worst? There are no real limitations...
Polynomial algorithms are algorithms which needs polynomial time to compute something (e.g. O(n^2) or O(n^3)). A non-polynomial algorithm (or better exponential) are algorithms which have a really bad runtime (depending on input) (e.g. O(2 ^ n) or O(3 ^ n)).
For further information about this topic take a look at the topic "Computational complexity theory" hosted by Wikipedia. (Also information about complexity classes and O-Notation).
Hope this helps a bit
Regards
Sebastian
|
|
|
|
|
What's the difference between the 2 types
|
|
|
|
|
By value the parm is a copy of, by reference, a pointer-to is passed.
|
|
|
|
|
It matters when u pass such parameter into function. Simple types - like int or string will be passed as a copy, so it means that whatever u change in this parameter in this function, wont be reflected in a real variable, that u passed in this function.
|
|
|
|
|
There are at least 3 types of parameters to a function, not two.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
|
I don't know the absolute definition for structured programming but it goes something like this. Structures can represent both data and programming technique. Data structures are a definition of what something should look like, for example an employee has a name, an address, an age, a gender. These attributes could all be defined in a data structure. Structured programming may take the approach that each section of the program handles specific functions. For example you start off by defining all of your data structures, followed by methods, followed by the main program. You will use coding standards such as specific error handling etc.
Object Oriented programming takes all of the above and encapsulates methods and data into an object. It's main purpose is to "hide" methods and data for the sake of easier access. It's secondary function is to allow for code reuse.
Search the internet for "Gang of Four" "Design Patterns" etc.
|
|
|
|
|
Hi all,
i am working on a desktop application and want to create an oval shaped form.
I read about this in an article and worked as mentioned in that.
i.e. create an image, set the FormBorderStyle to None,
set the transparency key and all those stuffs,
But this doesn't work on 32 bit VGA monitor settings
and if i set the VGA to 16 bit still the shape is not displayed clear
i.e the Borders display some part of the form.
Any ideas about this will be appreciated.
Thanks & Regards,
Pramod
|
|
|
|
|
Please search www.windowsforms.net, You'll find a free library for shapped forms. I have also used it in some of my projects. The correct keyword to search this will be Region Control or Region Master Controls. Of you cant find it. Feel free to conact me at
rizwansharp@hotmail.com
Cheers!!!
|
|
|
|
|
Hi,
I want to send the message to specific users on the network.
Through the active directory, i am getting the all the users on the Domain.
But at that time i don't know the information regarding is he login or not?
Or in what machine he is loggein?
Can i do this?
|
|
|
|
|
You can use windows' net view command with Process class of .Net to dump the all compter's list on the network.
Then use the run the net send command with the help of Process Class to send message to any specific computer.
If you face any problem. Feel free to contact me @ rizwansharp@hotmail.com
Cheers!!!
|
|
|
|
|
I am wanting an XML output from a query of an SQL: database.
My initial idea was to do this via a dataset... but I wasn't sure if .NET or MSSQL had some whizz-bangery built in that alowed you to get XML direclty out of XML?
Any suggestions on the best method of achiving this ?
|
|
|
|
|
|
Depends on your usage. You could use a simple FOR XML cluase on your query. If you wanted to control the output based on a schema then it gets a little more difficult. I think using a DataSet would be the easiest to implement though. Again depending on your usage.
|
|
|
|
|
Hello, I have a big problem to print an html file directly to the printer. I
use an "AxSHDocVw.AxWebBrowser" object. Briefly, this is my code:
AxSHDocVw.AxWebBrowser myBrowser;
...
//this set of instruction prepare my document in html to be printed
string HtmlFileName = "Test.html";
Object o = new Object();
o = System.Reflection.Missing.Value;
myBrowser.Silent = true;
myBrowser.Navigate(HtmlActualFileName, ref o, ref o, ref o, ref o);
// when it is ready the callback goes here
private void myBrowser_DocumentComplete(object sender, System.EventArgs e)
{
myBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, ref o, ref o);
}
When i call it (ExecWB) it generates an exception "Trying to revoke a drop
target that has not been registered".
Someone know how I can solve this problem, or if there is a quicker o
simpler method to solve it?
Thank you,
Regards,
SD3
|
|
|
|
|
Hi!
All I want is to create a BHO (Browser Helper Object) which among the other things it does, it displays something onto the IE's statusbar. The problem is how to access the rest fields of the IE's statusbar.
IWebBrowser2 gives only access to StatusText which is the first field from the 7 (as I can see in my IE).
I want to add a small icon to a statusbar field and when clicked do some stuff.
thanks,
eLefas
-- modified at 5:27 Tuesday 18th July, 2006
|
|
|
|
|
Hi!
I've got a windows service that can be configured to use an access DB (for smaller installations) or a SQLServer DB (for larger installations).
The problem I'm facing at the moment is that usually after a (re)boot the SQL Server service isn't up and running completely at the moment my service is started.
Since my service is checking some values from the database on statup, it's choking regularly because SQL Server hasn't started my database yet.
Is there a way to influence the order in which services are started?
I've already tried to set my service's dependencies to make it depend on SQLEXPRESS, but to no avail. Looks as if SQLEXPRESS is already started, but my database hasn't been started yet.
Setting the options to restart the service after a failure doesn't work either - it only restarts the service when I shut it down via taskmanager for example, but not if the initial start of the service failed because the database wasn't available yet.
The problem occurrs with SQL Server 2005, I couldn't experience this behaviour with SQL Server 2000. Seems as if SQLServer 2000 started faster so the problem couldn't arise.
Any other idea what I could try?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|