I have spent a considerable amount of time in trying to find an algorithms which solves this problem.Most of the sites display the use of a recursive function to solve this problem.I am still relatively new to programming and not really able to understand the logic involved in the problems.It would totally be nice if someone tool time to completely elaborate and explain it.
Thanks in advance.
Please read this post
Understanding Recursion to generate permutations
hopefully it will helpful ...
Related
Okay here is my problem. I have to implement the Gale-Shapley algorithm for the alignment of two ontologies. I read the first 200 pages of the book "Ontology Matching" by Jerome Euzenat and Pavel Shvaiko and now I understand some of the basics of ontology matching but the problem is that the more I read the more confused I become. I really think that the problem is relatively easy but I really can't get around it and I am not getting clear instructions from my professor as they insist that I should decide everything on my own. The problem is that I don't understand the whole process. I understand the Stable Marriage Problem, I understand the basics of ontology matching but I can't seem to "connect" everything. If somebody could explain to me how the whole thing should look and how to start (the basics of a Design Document) I will be incredibly grateful.
I'm brand new here, and also to Lua, so please bear with me...
I'm building an Airport in Minecraft, with my kids. I'm an overachiever and a dreamer, and at some point, my brain decided it would be a FANTASTIC idea to add in a cosmetic element that I have absolutely NO idea how to do. Smart, right?!
See, I got it in my head that I want to have display screens in our Airport that show the flight information of incoming/outgoing flights. Fast forward to my discovery of the Opencomputers mod for Minecraft, a few hours of watching tutorials on how to operate it, and thus began my search for knowledge of that which is the Lua language. Fortunately, I have a wee bit of coding experience (thanks to my college days) and I picked up the very basic of the basics. (It seems similar to C.) I've gleaned just enough to accomplish the bigger part of my goal: I've managed to write the bare bones of the program I dreamed up, and it works...for the most part. (I still need to figure out some redundancies and such...all in good time.)
But...it's so very plain, and not fancy at all. It doesn't look even remotely like what I was picturing in my head, and this simply will not do. So now I am on a quest to discover how to format the output of my program and make it look fantastic...or at least, as close as I can get it to what was in my head. I have managed to figure out how to change the gpu screen colors (foreground, background) so that is why it's blue/white. But it's not quite what I wanted, and it resets if the system is turned off. My goal is to change the format of the program output itself, not just the Opencomputers screen block. I've googled this until I'm blue in the face, and I have pored over forums and code tutorials and the like...only to fail at finding the information I need. It's possible that I've passed up the answer, simply because I'm still very new to the language, but that's another good reason for me to be here, right?
And so, I turn to you, O Great Dwellers of the Interwebs, the Keepers of Vast Programming Knowledge, for assistance. Please, pretty please, help me make my program look awesome. My kids just may think I'm the coolest Mom on the planet, and that would be more than fantastic...Not to mention we'd have one kickass airport to play around in. :)
Here's what you'll probably want to know:
First, This pic is what I want, (on the left) and what I have (on the right).
And here is the code for my program: http://pastebin.com/60nPfpB8
I apologize up front for all of the noob mistakes that my code is more than likely riddled with. I haven't figured out yet how to make the functions repeat themselves, or a good way to utilize a 24 hour clock for the "time" function. So any suggestions there would be welcome as well.
Thank you for taking the time to read, and I appreciate any help I can get with this. :)
Hey guys, I always get confused by this so it's not exactly my strong point :( Am I understanding correctly that the above example suggests:
One shop must have one or more clients
One client must have one shop
If there was to be a circle where at the end of the client arrow it suggests that the shop has zero or many clients.
I know it's a bad example but I am just trying to get my head around it. (Always get it the wrong way round)
Thanks very much, all help appreciated.
it's just a quick example so I apologise for the bad naming convention of table names
Yes, you are understanding correctly.
I'm thinking about writing a program that asks the user to think of an object(a physical one) and then it asks questions about the object and tries to figure out what the user was thinking. (Similar to http://20q.net)
I tried to do it in Python but figured my approach was naive and would be very inefficient. How would you guys do this?
Doing this efficiently requires a somewhat advanced method in probability called Kullback-Liebler Divergence. Applied to decision trees (which is what you want to do) it is often called Information Gain.
But don't let that stop you! Do some searches for implementation samples of decision trees and start from there. I'd write a much simpler program before you go about solving 20 Questions.
Also, take a look at http://www.20q.net/ . Click "Think in English" then "Classic 20Q". It's scary good, sometimes.
Sounds like you want to make a computerized 21 questions game. I'd do it with a tree of questions and answers.
Here is a nice stackoverflow article about implementing trees in python
How can I implement a tree in Python? Are there any built in data structures in Python like in Java?
Could someone give me some advice or a snippet of code that would show me the way of implementing the method in this listing . I would like to get some info about processes on a mac. I'm not so good with C, but am familiar with Objective C.
Thanks!
I found this answer on cocoabuilder which is a good start, but it could use some expanding.