A case study for search techniques in AI

We are teaching an artificial intelligence class and we need a different case study other than geographical maps (the popular example is the map of Romania) to explain the difference between Breadth-first search and Depth-first search solutions. We plan on giving it to the students to use as a semester project. Answer AttributionSource : Link … Read more

How to represent OOP concepts in algorithms in a standard way?

I have usually been using the Cormen algorithm format to teach some introductory courses in Programming. I mean something like this: TreeSearch(k,n) 1. if x==NIL or k==x.key 2. return x 3. if k<x.key 4. return TreeSearch(k.left,n) 5. else return TreeSearch(k.right,n) Actually I have not agree with a couple of lecturers in my institution that they … Read more

what would be the drawbacks of lecturing two programming languages simultaneously?

One colleage came with the idea/comment that it would be useful to lecture two programming languages, eg. Java and Scheme, at the same time while lecturing an Introduction to Programming course aimed for first term undergraduates. I have my doubts that approach could stuck some students in learning the syntax of the programming language instead … Read more

What’s the big deal with the knapsack problem?

In my CS course, we are covering things from one topic to another in sort of a sensible manner. For example, binary search tree -> 234-tree -> red-black tree -> heap -> greedy algorithms -> dynamic programming. And all the sudden, bam, there is this whole chapter on the knapsack problem. How is this problem … Read more

Need help understanding a derivation of “witnesses” for a Landau bound

So here’s an excerpt from Foundations of Computer Science by Alfred Aho and Jeffrey Ullman[1]. I’ve also found basically the same material in a few other places, and also in my discrete math textbook, but this is clearest one I’ve seen: Example 3.2. Suppose we have a program whose running time is T(0)=1, T(1)=4, T(2)=9, … Read more

Explaining why FFT is faster than DFT for the general public?

How would you explain why the Fast Fourier Transform is faster than the Discrete Fourier Transform, if you had to give a presentation about it for the general (non-mathematical) public? Answer FFT is an algorithm for computing the DFT. It is faster than the more obvious way of computing the DFT according to the formula. … Read more