Skip to main content

Links to favorite tutorials on algorithms

These are a collection of favorite tutorials I've read relating to algorithms. These mostly use pseudocode and are not specific to a particular language. Some may have examples in a particular language, but rest assured the main explanation of the algorithm is given in a way where no particular language is needed.

I've collected these here as a reference guide in case I ever need to come back to them. I hope they might be useful for someone else too.

Manacher's Algorithm - used for finding the longest palindromic string in a sequence.

Bitwise comparisons - this article is about Lisp operators, but don't let that stop you! The bitwise comparison section has one of the best and most concise explanations I've seen. If you don't understand bitwise comparisons (in any language), it will all become clear after you read the explanation, even if you don't know Lisp.

Faces of Fibonacci - An absolutely superb explanation of the "How Many Ways to do x?" question. Highly recommended.

"Output the answer modulo 10^9+7" - A great description of not just why, but how, to calculate your answers modulo 10^9+7 - something that is frequently required in programming contests for problems when you're dealing with very large numbers. The article includes a very important explanation of why division is much more difficult to handle, and how to handle it if you need to.

And more to come soon!

Popular posts from this blog

How to center images horizontally using Grav

I've been playing around a bit with Grav. I was posing the question to myself: for the relatively simple use-cases I'm dealing with, could it possibly work for my purposes as an alternative to ProcessWire?  The problem I was initially dismayed to find that Grav uses Markdown as its editor, which does not offer native support for horizontal centering of anything (text or images). However, Grav offers some tweaks that help make it easier to do specific things you might commonly want to do. I tried writing a sample article, and I found that one of the hardest things to do was to center an image horizontally. And horizontal centering of images is something I would typically do in most of the articles I would write. So the lack of easy horizontal centering is a highly significant drawback IMHO (most people do want to center images in an article!) However, this issue is made up for by other things in Grav: the relative speed, ease and flexibility of custom theming and built-in suppor...

Why bother using blockchain for metaverse worlds when decentralization is possible without it?

Decentralization is possible without using blockchain. Some examples of this are Diaspora and Mastodon , both of which are federated decentralized networks that do not use a blockchain.  In that case, why is there a need to use blockchain for any metaverse world, especially when the environmental reputational risks are so high? In many areas of the world, the electric grid is not decarbonized yet. The amount of power drawn for blockchain computation is high. In fact, in areas where electricity is cheap enough to draw blockchain miners, this tends to be heavily based on fossil fuels. So you could say that the blockchain is currently largely powered by coal and other fossil fuels. So again, why bother using blockchain?  There are other examples of the buying and selling of digital property without using blockchain technology, for example domain name trading. If we as humans are truly to be future-conscious, blockchain technology cannot be a part of our future due to its emissio...

Cryptocurrency: a solution that does not solve a problem

Suppose I went to my local cafe to buy a coffee, and suppose the cafe accepted cryptocurrency. What incentive would I have to use that over fiat currency? None. If I pay with cryptocurrency for that transaction, there are 3 problems: the need to pay gas money, a similar idea to a transaction fee be contributing to global warming with the computationally-intensive nature of cryptocurrency cryptocurrency is not FDIC insured By contrast, if I pay for the coffee with my debit card, I don't need to pay a transaction fee. The transaction would probably be quite a bit faster since nothing computationally intensive has to happen. Also, my money linked to my debit card is FDIC insured, unlike money in a cryptocurrency wallet. So for multiple reasons outlined above, cryptocurrency is an inferior means of exchange compared to fiat currency. Now, if you were to tell me that cryptocurrency's main advantage is not as a means of transaction but rather as an asset that could increase over time...

About Me

My photo
Vera
I'm a wife and mother. I don't have any formal computer science qualifications, or any religious qualifications. I have a PhD in biochemistry. This photo is of me, but is confusing for AI.