Equal Stacks

While I was waiting for some tests to complete I checked my Gmail and found a message from HackerRank suggesting a challenge. The Equal Stacks challenge may be found under Practice > Data Structures > Stacks > Equal Stacks. I read the description for the problem and decided to tackle it using stacks; how creative of me. Continue reading “Equal Stacks”

Transform Strings

It is Sunday morning in the Twin Cities of Minneapolis and St. Paul. Woke up around 04:30 AM and spent the next couple hours working on Machine Learning with Big Data. It is a Coursera course. Have one more week to complete this course; so far so good. After preparing and having breakfast with my best half, return to my computer. Continue reading “Transform Strings”

Fibonacci Sequence

Lately I have not had the time to write in this blog. For the past several months I have been getting up seven days a week, no later than 04:30 AM. I am taking a specialization on Big Data and machine learning. Loving every minute but it does not leave time at the end of the day to sit down and do something in order to be able to write a post. Continue reading “Fibonacci Sequence”

More than a List of Words

When indexing text based word frequency / relevance which may be applicable for web searches, one of the procedures used is to create a term frequency (tf) array followed by an inverse document frequency (idf) one. You can read more about this here.

In a previous post I experimented with some text in order to build hashmaps with the words of sentences (to keep things in perspective for a blog post). In that post I used a string that I copied from a course I took some years ago. The sting was already preprocessed. The text had already been stripped off punctuation marks. Continue reading “More than a List of Words”

Vector Model and Similarity Search

Have you ever wondered how computers search for text and similar images?

For example, if you use Windows, open a File Explorer window. From top to bottom the windows has the title bar, the menu bar, the tool bar. Under the toolbar there are two text fields. The one on the left displays the full path to the current folder / directory. The one on the right displays “Search <current_folder>” e.g., “Algorithms”. I have enabled in my computer “Index Properties and File Contents”. By default when you search, Windows will only search the file names and properties; not the contents of the file. Depending on your usage, you might need to index some or all the files in all folders in your computer. In my case, I perform searches in all types of documents. If you mostly use the Office Suite, you might enable search only on folders holding your *.docx files. The reason for this is that the mechanism uses additional disk and memory to operate. Continue reading “Vector Model and Similarity Search”

Radix Sort

Earlier this week I ran into a description of Radix Sort. This sorting algorithm has been around for a few centuries (yes; that is not a typo). The algorithm dates back to 1887 to the work of Herman Hollerith (and yes; he was the inventor of the Hollerith Card Code for punched cards used in the past century).

This sorting algorithm is not the fastest, it requires additional space, but has been around for a long time. When you read about it, seems like it should not work; but it does. Continue reading “Radix Sort”

Code Complexity

Code complexity is a subject that is taught early on in Computer Science curricula. Not sure if early is the reason why many software developers tend to forget what it is and how to apply it.

Last week a group of developers were talking about the complexity of algorithms and Big O Notation came up. As a matter of fact when considering complexity there are:

Theta notation
Big O notation
Omega notation

Continue reading “Code Complexity”

Two Dimensional Array

A few days ago a group of software engineers were discussing how the order in which the numbers of rows versus columns in a two dimensional array affect performance. That is; if an array has more rows than columns as opposed to more columns than rows, the time it takes to traverse the array will be affected. Continue reading “Two Dimensional Array”

Parse Text

UPDATE – April 09, 2018When I started this post, I was thinking in several follow ups in order to try different approaches and be able to continue to improve on previous passes by adding code or starting from scratch when a new idea came up. I was interested in showing a normal progression that the reader would encounter when developing software. In the days that passed, I decided to limit the subject to a single post. Please let me know if you encounter an issue or would like for me to expand on this entry.

Sometime last week I attempted to solve a simple online challenge. The challenge dealt with parsing a string of text and then obtaining information from the string. There are probably thousands of variants to the challenge. I am not going to cover the exact challenge in this post. I will make my own. Will start simple and will get more complex each time we add a new obstacle. Continue reading “Parse Text”

Managing Binary Trees – Linux

This post deals with an API for binary trees in Linux. The API consists of the following functions:

Function Brief Description
tdelete() Deletes an item from a tree.
tdestroy() Deletes the entire tree.
tfind() Finds an item and if not found returns NULL.
tsearch() Search a binary tree for an item.
twalk() Performs a depth-first, left to right tree traversal.

In the past I have used and implemented, using different programming languages, several classes, methods and functions to deal with binary trees. Binary trees are used to keep data in sorted order. This allows for quicker search times. This particular implementation comes with the Linux operating system. You can read more about it by typing on a Linux console:  man twalk Continue reading “Managing Binary Trees – Linux”