This is another version of Trie implementation in my previous post. The new one comes with a flag to identify a complete word.
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Friday, February 10, 2012
Groovy : Trie Implementation
From Wikipedia:
In computer science, a trie, or prefix tree, is an ordered tree data structure that is used to store an associative array where the keys are usually strings. Unlike a binary search tree, no node in the tree stores the key associated with that node; instead, its position in the tree defines the key it is associated with. All the descendants of a node have a common prefix of the string associated with that node, and the root is associated with the empty string. Values are normally not associated with every node, only with leaves and some inner nodes that correspond to keys of interest.
In computer science, a trie, or prefix tree, is an ordered tree data structure that is used to store an associative array where the keys are usually strings. Unlike a binary search tree, no node in the tree stores the key associated with that node; instead, its position in the tree defines the key it is associated with. All the descendants of a node have a common prefix of the string associated with that node, and the root is associated with the empty string. Values are normally not associated with every node, only with leaves and some inner nodes that correspond to keys of interest.
Labels:
Algorithm,
Data Structure,
Groovy,
Java,
Trie
Tuesday, January 31, 2012
Introsort implementation by Groovy.
Another groovy homework. this time Introsort.
From Wikipedia :
Introsort or introspective sort is a sorting algorithm designed by David Musser in 1997. It begins with quicksort and switches to heapsort when the recursion depth exceeds a level based on (the logarithm of) the number of elements being sorted. It is the best of both worlds, with a worst-case O(n log n) runtime and practical performance comparable to quicksort on typical data sets. Since both algorithms it uses are comparison sorts, it too is a comparison sort.
From Wikipedia :
Introsort or introspective sort is a sorting algorithm designed by David Musser in 1997. It begins with quicksort and switches to heapsort when the recursion depth exceeds a level based on (the logarithm of) the number of elements being sorted. It is the best of both worlds, with a worst-case O(n log n) runtime and practical performance comparable to quicksort on typical data sets. Since both algorithms it uses are comparison sorts, it too is a comparison sort.
Labels:
Algorithm,
Groovy,
Intro sort,
Java,
sort algorithm
Friday, January 27, 2012
Log base 2 of an N-bit integer
Another Groovy training post. This time, three different method to find log base 2 of an N-bit integer.
Note: All algorithms and code credits goes to Bit Twiddling Hacks.
Note: All algorithms and code credits goes to Bit Twiddling Hacks.
Labels:
Algorithm,
Groovy,
Java,
Log Base 2
Sunday, January 22, 2012
Priority Queue - Groovy Implementation
Here it is :), Another data structure, implemented by me in Groovy as part of my Groovy learning practices.
Priority Queue.
Friday, January 20, 2012
Quick Sort, My Groovy Implementation
My Groovy Implementation for QuickSort:
Labels:
Groovy,
Java,
Quick Sort,
sort algorithm,
Sorting
Tuesday, January 17, 2012
Heap Sort Implementation in Groovy
My Heap Sort Implementation in Groovy :
Labels:
Groovy,
heap sort,
Java,
sort algorithm
Tuesday, January 10, 2012
My Merge Sort in Groovy
I'm Learning Groovy :) and This is my groovy implementation of Merge Sort.
Labels:
Groovy,
Java,
Merge Sort,
Sorting
Saturday, November 5, 2011
Spring: The art of using GRASP Patterns
When we search for design pattern articles, we found essentially documentation concerning “Gang of Four” patterns, they are very useful and contribute to well design application.
But when I discovered GRASP principles , I advice any one interested to improve his skills design to look at these principles, it gives a design fondamental rules.
In this article we will discover some GRASP principles used by Spring, and the advantages of using them.
Labels:
GRASP,
Java,
JavaDepend,
Spring
Subscribe to:
Posts (Atom)