Archive for September, 2010


Sequential Search.

This algorithm checks whether the number ‘v’ is contained in a set of numbers already stored in the data a[0], a[1], …, a[r-1] of the array ‘a’ (where ‘r’ the number of elements in it), comparing it sequentially with all numbers, starting from the beginning. If the check reaches the end without finding the number, the value -1 is returned. Otherwise, we are returned the index of the position of the one-dimensional array containing the number.

Continue reading

This project refers to an Arduino library implementing a generic, dynamic queue (array version).

The data structure is implemented as a class in C++.

For more information, you can get the project itself ‘QueueArray‘.

If we replace the loops ‘for’ of the simple version of weighted quick-union (you’ll find it in a previous article) with the following code, we reduce the length of each route passing to the half. The end result of this change is that after a long sequence of operations the trees end up almost level.

Continue reading

This program reads from the standard input a sequence of pairs of non-negative integers which are less than N (interpreting the pair [p q] as a “link of the object p to object q”) and displays the pairs that represent those objects which are not yet connected. The program complies with the array ‘id’ to include an entry for each object and applies that id[q] and id[p] are equal if and only if p and q are connected.

Continue reading

If we replace the body of the while loop of the quick-find algorithm (you can find it in a previous article) with the following code we have a program that meets the same specifications as the quick-find algorithm but performs fewer calculations for the act of union, to the expense of more calculations for act of finding. The ‘for’ loop and the ‘if’ operation that follows in this code determine the necessary and sufficient conditions in the array ‘id’ that p and q be linked. The act of union is implemented by the assignment id[i] = j.

Continue reading

This program is a modification of the simple quick-union algorithm (you’ll find it in a previous article). It uses an extra array ‘sz’ to store the number of nodes for each object with id[i] == i in the corresponding “tree”, so the act of union to be able to connect the smaller of the two specified “trees” with the largest, and thus avoid the formation of large paths in “trees”.

Continue reading

This project refers to an Arduino library for implementing a generic, dynamic queue (linked list version).

The data structure is implemented as a class in C++.

For more information, you can get the project itself ‘QueueList‘.

This project refers to an Arduino library implementing a generic, dynamic stack (linked list version).

The data structure is implemented as a class in C++.

For more information, you can get the project itself ‘StackList‘.

This project refers to a sketch (an Arduino program) in which you have the ability to run applications with the help of an infrared receiver (IR) and a remote control. Also included in this project is a Python script that implements a background service (Daemon) which communicates with the Arduino and initiates the execution of various applications. The program can manage several remote controls following the communication protocols NEC, Sony SIRC, Philips RC5 and Philips RC6. Also, you are given the opportunity to train the software to respond to specific keys from several remotes (the knowledge is recorded in the EEPROM of the Arduino).

Continue reading

This project refers to an Arduino sketch that implements a calculator which valuates infix mathematical expressions using appropriate algorithms and data structures. The mathematical expressions are given through the USB port, while the valuation and presentation of results is done by Arduino. The results are displayed in an appropriate LCD display.

Continue reading

In this article, I quote a personal documentation implementation of the source code of the application “GNU Find String” using the Doxygen system. The source code of the application is written in ANSI C. You’ll find the documentation here: Doxygen documentation of the source code of the application “GNU Find String”.

Continue reading

This project refers to an Arduino sketch that implements a motion detector for driving and controlling other devices using a passive infrared sensor (PIR) and an electromechanical switch (relay). The program examines whether there is movement (the detection range of the detector is about 6 meters) in space (via the sensor PIR) to activate the device via the relay.

Continue reading

This project refers to an Arduino sketch which with the help of a relay (electromechanical switch), the system VRBot and the expansion card for sensors (Sensor Shield) can control (enable or disable) an external device (eg. a lamp, a car alarm, a home air conditioner, etc.) with a double beat of the palm.

Continue reading