Posts

A Simple Binary Tree Implementation in C++

Image
A very basic binary tree implementation in C++ that defines a binary tree node, adds new nodes and prints the tree. [code language="cpp"] #include <stdio.h> class Node { public: Node( int v ) { data = v; left = 0; right = 0; } int data; Node* left; Node* right; }; void Add( Node** root, Node* n ) { if ( !*root ) { *root = n; return; } if ( (*root)->data < n->data ) { Add( &(*root)->right, n ); } else { Add( &(*root)->left, n ); } } void Print( Node* node ) { if ( !node ) return; Print( node->left ); printf( "value = %i\n", node->data ); Print( node->right ); } int main() { Node* root = 0; Add( &root, new Node( 1 ) ); Add( &root, new Node( 2 ) ); Add( &root, new Node( -1 ) ); Add( &root, new Node( 12 ) ); Print( root ); return 0; } [/code] Output:

Displaying AVI Video using OpenCV

Image
A short demonstration of how to use OpenCV to capture and display video frames from an avi file. The code demonstrates how to capture video from an example video (avi) file, get information in the form of frames per sec. and display the video.

Problems Accessing Linux Folders and Servers from Windows

Image
A short posting on dealing with accessing shared directories from remote Windows machines. When trying to access a shared folder stored on a Linux server from (say) a remote Windows XP machine you may have come across the following error message in much the same way as I did:

Getting Started with FFMPEG for Windows

Image
Some pointers on how to get ffmpeg installed for use in Windows environments.

Hash Tables as a means of fast lookup in STL / C++.

Introduction In a previous life I was involved in the design of routing optimization software for the telecoms industry. Finding the least cost route for a traffic demand between communicating network sites necessitates a search for all the tariffs provided by all of the carriers.

A Recursive Algorithm to Find all Paths Between Two Given Nodes in C++ and C#

Image
Problem Outline This I tackled previously when working on the design and implementation of routing optimization algorithms for telecommunications networks. Given that a wide area network with nodes and interconnecting links can be modelled as a graph with vertices and edges, the problem is to find all path combinations

How to Set up a Subversion (SVN) Server in Linux

Image
This guide details the steps taken to create a proper SVN server, as opposed to using a not-recommended network share , as means of creating and accessing repositories.