Wednesday, October 30, 2013

Writing a programming / algorithmic book

I wanted to take on a new challenge and start writing a book about algorithms and design. The intent is to have Simplicity by Design (SD): every Chapter is a collection of 15-30 questions, followed by the solution, followed by a C++ code snippet which can be easily re-used.

So far, I have drafts for 3 chapters: bit programming, dynamic programming, and graphs. Here an example of graph code with very classical questions: implement a graph, implement bfs, implement dfs, implement topological sort, I already have code for other graph problems. Dynamic programming has more mathematical content and I will publish an excerpt next weeks.

A number of questions:

  1. Should I publish code for public review? If so, can i still use it for the book?
  2. Should I publish questions for public review?
I think that this will be one of my side projects off work for the next year or so.


Sunday, September 29, 2013

Create your Team

you have a pool of players. Each player ha a set of skills. For creating a team you need to hire the minimum number of players who have together a predetermined set of skills

Wednesday, September 25, 2013

Find i = n^3 + m^3

how can a number be expressed as sum of two cubes?

52 cards

You have 52 cards half of them are red and half of them are black. You have a given amount of money M and every time you can bet k < M money. If you predict the right colour you will win 2k money, if not you will loose k. What is the best strategy?

Monday, September 23, 2013

Conflits in k keywords

A keyword is made up of n bits. Given k keywords generated with uniform probability what is the probability to have collision? Provide an evaluation and write the code.

Sunday, September 22, 2013

Radix Sort -

Write a radix sort implementation in C++

Saturday, September 21, 2013

PageZero and Ted

I enjoyed attending Ted and give a talk about PageZero. While I was listening a number of very inspiring talks, I asked to myself would this PageZero really help users?

So I started to write {Ted} and immediately PageZero suggested {Ted Talks} as first suggestions and {Speakers} Speakers as su-bintent. That's exactly what I was looking for!!! I am impressed.








Then, I thought and what if I was interested in the Movie? PageZero predicted that potential choice too. Kind of cool, no?

Friday, September 20, 2013

Buying with constrains

You have a bag with capacity C and can insert items with value wi which will occupy space si. You cannot exceed the capacity. Write an algorithm in C++

Thursday, September 19, 2013

Project PageZero

SearchBox never changed since 1993, when the first search engine was created. Bing is disrupting the box by bridging the gap with the World of Entities. Names, Web Sites, and Generic Entities are directly accessible and understood as soon as you type.



http://www.slideshare.net/antoniogulli/project-page-zero-bi

Tuesday, September 17, 2013

k balls, n floors

There is a building with n floors and you have k balls. Balls are identical and when you drop them they can break or not. You need to figure out the highest floor of the building an egg can be dropped without breaking.

Monday, September 16, 2013

Friday, September 13, 2013

Design Patterns : C++ full collection of Gamma's patterns

Design Patterns : C++ full collection of Gamma's patterns

Full collection of Gamma's patterns in Full collection of Gamma's patterns in c++:
  1. Creational: Abstract Factory, Builder, Factory, Prototype, Object Pool, Singleton,
  2. Structural: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy patterns,
  3. Behavioral: Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Template, Visitor, and Interpreter

Thursday, September 12, 2013

Capped payrolls

In a company there are different payrolls pi, and we want to find a cap C such that the total amount of money paid is not above a maxim M. How can you determine C?

Wednesday, September 11, 2013

Int 16 bit - compute the sqrt

Given an integer in 16 bits compute the sqrt
Subscribe to: Comments (Atom)

AltStyle によって変換されたページ (->オリジナル) /