 An algorithm is little more than a series of steps required to perform some task. If we treat each step as a basic unit of computation, then an algorithm’s execution time can be expressed as the number of steps required to solve the problem.
This abstraction is exactly what we need: it characterizes an algorithm’s efficiency Read More → Subset sum problem is to find subset of elements that are selected from a given set whose sum adds up to a given number K. We are considering the set contains non-negative values. It is assumed that the input set is unique (no duplicates are presented).
Exhaustive Search Algorithm for Subset Sum
One way to find subsets that sum Read More → Recursion is a tool not often used by imperative language developers, because it is thought to be slow and to waste space, but as the author demonstrates, there are several techniques that can be used to minimize or eliminate these problems. He introduces the concept of recursion and tackle recursive programming patterns, examining how they Read More → A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is Read More → Introduction
Each natural number that is divisible only by 1 and itself is prime.
Prime numbers appear to be more interesting to humans than other numbers.
Why is that and why prime numbers are more important than the numbers that are divisible by 2, for instance ?
Perhaps the answer is that prime numbers are largely used in Read More → QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.
1) Always pick first element as pivot.
2) Always pick last element as pivot (implemented below)
3) Pick a random element as pivot. You are not allowed to use loop constructs like while, for..etc, and you can only use the following ADT functions on Stack S:

isEmpty(S)
push(S)
pop()

Solution
The idea of the solution is to hold all values in Function Call Stack until the stack becomes empty. When the stack becomes empty, insert all held items one by one at the Read More → Introduction
In computer science, a B-tree is a tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time.
The B-tree is a generalization of a binary search tree in that a node can have more than two children. Unlike self-balancing binary search trees, the B-tree is Read More →

Problem
Implement a function that checks whether a positive number is a palindrome or not. For example, 121 is a palindrome, but 123 is not.
Sollution
It is easy to check whether a string is a palindrome or not - we can check whether the first character and the last one are identical, and then compare the second Read More →

Problem
If you have a 2 GB file with one string per line, which sorting algorithm would you use
to sort the file and why?
Solution
When an interviewer gives a size limit of 2GB, it should tell you something - in this case, it
suggests that they don¡¯t want you to bring all the data into memory
So what do Read More → Tris volumineux
Les algorithmes de tri doivent aussi être adaptés en fonction des configurations informatiques sur lesquels ils sont utilisés.On suppose que toutes les données sont présentes en mémoire centrale (ou accessibles en mémoire virtuelle). La situation se complexifie si l'on veut trier des volumes de données supérieurs à la mémoire centrale disponible (ou Read More →

#include "stdlib.h"
#include "stdio.h"
#include "stdbool.h"

// Fonction d'affichage
void affichage (int grille)
{
for (int i=0; i

Given an array of integers which is initially increasing and then decreasing, find the maximum value in the array.

Input: arr[] = {8, 10, 20, 80, 100, 200, 400, 500, 3, 2, 1}
Output: 500
Input: arr[] = {1, 3, 50, 10, 9, 7, 6}
Output: 50
Corner case (No decreasing part)
Input: arr[] = {10, 20, 30, 40, 50}
Output: 50