I am looking for an algorithm that could find the two most distant elements in a binary tree, not looking for any special language, just for the algorithm.
Thanks.
How should I implement the classic bubble sort algorithm? I'd particularly like to see a C++ implementation, but any language (even pseudocode) would be helpful.
P.S. Not a homework.
What other good collaborative programming/software development/engineering websites do you know of? I'm not looking for language or platform specific websites. Nor am I looking for something similar to the format of Stack Overflow. My main criteria is that the community is
knowledgeable,
helpful
active
friendly
I know the question is open ended/subjective but I'd like to know as many places where I can get the help of my peers.
The accepted answer will
contain links to your recommended sites
have a short description
be concise
be highly voted by your peers
How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list of characters.
Any language would work but it should be portable.
The topic of algorithms class today was reimplementing data structures, specifically ArrayList in Java. The fact that you can customize a structure for in various ways definitely got me interested, particularly with variations of add() & iterator.remove() methods.
But is reimplementing and customizing a data structure something that is of more interest to the academics vs the real-world programmers? Has anyone reimplemented their own version of a data structure in a commercial application/program, and why did you pick that route over your particular language's implementation?
As far as I understand the "branch-on-sign" is the name of some kind of if statement that does something depending on sign. I'm not sure that it's just if (x<0) then ... else ....
However, the name "branch-on-sign" seems to denote something very concrete. So, what is it? Perhaps, it's language-specific, but I don't really know. Probably, it's related to embedded development.
Generate the Fibonacci sequence in the fewest amount of characters possible. Any language is OK, except for one that you define with one operator, f, which prints the Fibonacci numbers.
Starting point: 25 characters in Haskell:
f=0:1:zipWith(+)f(tail f)
Is there any deeper meaning in the fact that the word "statement" starts with the word "state", or is that just a curious coincidence? Note that english is not my native language, so the answer might be obvious to you, but not me ;)
Challenge:
Without using the modulus divide operator provided already by your language, write a program that will take two integer inputs from a user and then displays the result of the first number modulus divided number by the second number.
Example:
Input of first number:2
Input of second number:2
Result:0
Who wins:
In case you don't know how Code Golf the winner is the person who writes this program in the least amount of characters.
I have a 2D array
1 2 3
4 5 6
7 8 9
and want to sort it like this
Snake
1 2 3
8 9 4
7 6 5
Snake (different)
1 2 3
6 5 4
7 8 9
Rotated
1 4 7
2 5 8
3 6 9
Wipe (diagonal)
1 3 6
2 5 8
4 7 9
Well, you got it, all kinds of sorting.
Searching the interweb for hours now. Any resources (specific language or pseudo code) on that greatly appreciated...
The number 71867806 represents the present day, with the smallest unit of days.
How can I
calculate the currente date from it?
(or) convert it into an Unix timestamp?
Solution shouldn't use language depending features.
Thanks!
I'm looking for web app frameworks and/or database administration tools, either popular and unpopular, written in any language, for any relational database.
In short, I'm looking for web accessible CRUD front-ends with minimal programming effort.
For example:
phpMyAdmin (MySQL administration tool)
Ruby on Rails (web app framework with scaffolding)
What is the least amount of code you can write to create, sort (ascending), and print a list of 100 random positive integers? By least amount of code I mean characters contained in the entire source file, so get to minifying.
I'm interested in seeing the answers using any and all programming languages. Let's try to keep one answer per language, edit the previous to correct or simplify. If you can't edit, comment?
Hi there ,
i always asked myself. Why are there so many DB management systems?
I am not an DB expert and i never thought about using another DB than mysql.
Programming languages offer different paradigms, so there it makes sense to choose a specific language for your purpose.
What are factors to choose a specific DB management system ?
Was there a case in any server-side language where a code did not work in a browser while it did work in the rest?
I am asking this because I can't imagine such a scenario because server-side code runs in the server, not in the browser but I have seen discussions where, as said, there were "server-side browser compatibility issues". I can't seem to recall where I have read it.
Thanks in advance :)
Why are there so many Database management systems? I am not an DB expert and I've never thought about using another Database other than mySQL.
Programming languages offer different paradigms, so it makes sense to choose a specific language for your purpose.
Question
What are the factors in choosing a specific Database management system ?
I've long been under the impression that 'goto' should never be used if possible. While perusing libavcodec (which is written in C) the other day, I noticed multiple uses of it. Is it ever advantageous to use 'goto' in a language that supports loops and functions? If so, why?
I've a daunting task of getting familiair and possibly re-architecting large pieces of old source code.
I was hoping there would be a nice tool to convert php (in my case), but let's make it more general: any language to PDF, for offline browsing on a Kindle or Ipad
Would be ideal if it would create indexes / hyperlinks automatically. So function calls can be easily browsed into
I understand the reasons for compiler/interpreter language extensions but why is behaviour that has no valid definition allowed to fail silently/do weird things rather then throwing a compiler error? Is it because of the extra difficulty(impossible or simply time consuming) for the compiler to catch them)?
Any libraries to aid writing programs with source code shaped like drawings
(such as http://www.ioccc.org/1998/banks.c or http://groups.google.com/group/comp.lang.c/msg/e105e5d339edec01). For any language.
Possible Duplicate:
A puzzle - a program printing its own source
In your favorite programming language, write a program that, when run, will print out its own source code!
Sounds interesting, now let's go!
ps: Literally, there is "NO" use case for this, just plain curiosity!
Weird question but here it is. What are the programming concepts that were "automated" by modern languages? What I mean are the concepts you had to manually do before. Here is an example: I have just read that in C, you manually do garbage collection; with "modern" languages however, the language itself takes care of it. Do you know of any other, or there aren't any more?
What is the difference between a Map and a Dictionary? I am not asking for how they are defined in language X or Y(which seems to be what generally people are asking here on SO), I want to know what is their difference in theory.
I know a Map is an object that maps keys to values. Isn't a Dictionary the same?
Thanks
I've been programming for about 6 months, but i still feel like i haven't learned anything. Or maybe i'm overwhelmed by the things i still don't know. Am i doing something wrong here or is this normal?
I want to be able to work as a freelancer in a year or two, but i'm not sure if that goal is achievable.
So when did you feel comfortable using your programming language of choice and how did you learn it?
I know it's a very vague question, but maybe the answers could act like a poll about what could possibly be the next big event in computer science. A new language ? A new technology ? A new architecture ? A new business model ?
Please provide details, what is it and why do you think it's going to rule the world.