Monday, March 23, 2009
Sorting review so far..insertion the best
Normal Bubbleelapsed--6435455
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>
Decreasing n/window elapsed--22908
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>
Cocktail Sort elapsed--22908
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>
Insertion Sort elapsed--18159
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>
Let me explain what insertion does best. It tries to select a certain window and sorts that window and anything added to that window and slowly increases the window till it covers all. The worse case will be when the sequence is reverse and each entry needs to be move to the right, ie each window needs to sort. Here is such an example-->
Input array {100,50,40,30,20,10,9,8,7,6,5};
Normal elapsed--1939912
5>6>7>8>9>10>20>30>40>50>
Decreasing n/window elapsed--9778
5>6>7>8>9>10>20>30>40>50>
Cocktail Sort elapsed--10896
5>6>7>8>9>10>20>30>40>50>
Insertion Sort elapsed--10057
5>6>7>8>9>10>20>30>40>50>
As you can see, there isn't much significant difference between the last 3 because of the order of the array. It seems to tend to the same complexity O(n2). Here is a good site for this-->http://www.iti.fh-flensburg.de/lang/algorithmen/sortieren/insert/insertionen.htm
Tuesday, March 17, 2009
iShopSmart (ISS)
You grab your phone, open the app called iShop and use the camera function to take a snap of the label/name of the app in the panel and then wallah it searches the net and gets you the cheapest price available using shopping.google.com or simillar web service. Isnt this a great idea and i couldnt find any apps in itunes that does this. But i have too much on my plate to work on it right now. Thats one more thing to add to my to do list. Lets see where it goes....
1) I need to do edge detection
2) OCR
3)Google or someother deal finders/shopping web service.
4)Create a android app/iphone app out of it.
Wednesday, March 11, 2009
Wordpress...OMG
Since I am ardent fan of opensource world, I put forward a number of open source solution for various business needs and that’s when I got to work on Wordpress. Wordpress goes without saving is one of the most popular blog tool and I have seen it used by nearly most of my friends, in particular Arnab Deka.
The other day when I was posting some code in my blog, Arnab brought it up to me that the code was not formatted correctly. Well its not that I didn’t know that. It was pretty late at night when I submitted the Post and I didn’t want to waste my sleep formatting the code, so I just posted it. But then he also added that Wordpress has a plugin that does that for you. I was like WOW that’s neat. Why will anyone not move to wordpress. What the advantage of blogspot. What does blogspot have that wordpress doesn’t. I know what Wordpress has and blogspot doesn’t……..
Tuesday, March 10, 2009
Subset Creator
This code below generates subset of a given set. Its simple and stupid. Can anyone find a better way of doing it...
package DiscreateTut;
import java.lang.Character.Subset;
import java.util.Vector;
public class ShowSubset {
/**
* @param args
*/
static String[] Set= {"a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12" };
public static void main(String[] args) {
// TODO Auto-generated method stub
String nullSet="";
String intset=Set[0];
Vector subset = new Vector();
Vector tempSubset=new Vector();
subset.addElement(nullSet);
int x=1;
System.out.println("Start of array");
for(int i=0;i
for (int j=0;j
System.out.println(x+" = "+subset.get(j).toString()+","+Set[i]);
x++;
tempSubset.addElement(subset.get(j).toString()+","+Set[i]);
}
subset.addAll(tempSubset);
tempSubset.clear();
}
}
}
Thursday, March 5, 2009
iCollaboration
So this brings me to my next thought and I am ready for criticism. What’s the next big thing, that’s not in IT? Is it Nano technology or will Nano tubes eventually die down like Nuclear science or will Nuclear science rejuvenate and come to the lime light because of its recent promising advancement. Or is its re-usable energy that’s going to be in the center stage for the next decade. After all Obama is also supporting it. But then since we life in the age of 2.0, where everyone is talking about collaboration, cloud, SOA…..cant it be a coalescence of all the technology. Like Nano tech to make solar cells that will trigger a nuclear cell. What do you say about TECH 2.0 iCollaboration.
Wednesday, March 4, 2009
Sobel Method Edge Detection
Here are the results-->
Orig Image |