I always wanted to implement the logic behind the famous data structure of Java , HashMap and here it comes. Though it’s not the complete implementation considering all optimization scenarios, but it will highlight the basic algorithm behind the HashMap . So let’s start, this implementation will use my LinkedList implementation (Reason: for this implementation I thought to write everything from the scratch apart from primitive data types. Sounds weird? May be ;-) ). You may refer my earlier post on LinkedList , as I’m going to use it. HashMap is a key-value pair data structure, where you retrieve value by passing key. To optimize the search of key, a concept of Bucket (an Array of Java Objects) has been introduced. This is used, so that if search hits this Bucket , corresponding value element is instantly retrieved, otherwise it iterates sequentially through the Linked List associated with each Bucket element. So you can say if all HashMap elements get fit into the Bucket, retrieving...
Hello! Off-topic question,if you can help me:
ReplyDeleteI heard i can interact with a google spreadsheet in Android,programatically, if i use the Google Spreadsheet API. I saw the tutorial,they explain it well, but where do i actually get the API from ? i can't see it anywhere for download.. i would be grateful if you can give me link...thank you
Google's GData API doesn't work for android and there are limitations. You can try-
ReplyDeletehttp://code.google.com/p/google-spreadsheet-lib-android/
-Prasanta
thank you! i have downloaded and i am into your lib now. I am trying to getAllSpreadSheets() but it returns null (I have put my email address and password correctly); is there any other thing i have to do?
ReplyDeleteAlso, I would like to know if I have to put these operations in a separate thread , from the main activity (is it blocking?)
Again I have to ask you a question (the previous problem was because I didn't declare the permissions in manifest). I am trying to get the content of a worksheet (where previously I inserted information), and the HashMap corresponding to each record's data comes back with empty key-set,and I can't retrieve any value for the rows... I did as in your sample but it doesn't work..
ReplyDeletehello Prashant
ReplyDeleteI am unable to find the csv files created in the process
where arethese placed on the c drive
please reply
Yogen, it will be placed at the same directory from where you executed the Tool (unless there is some error in parsing or file creation)
ReplyDeleteThanks,
Prasanta
Hi
ReplyDeleteI get following exception at the end after running the program:
_Remaining Bytes to read: 0
Parse Contact Details....
java.lang.NegativeArraySizeException
at com.pras.IPDParser.parseContactDetails(IPDParser.java:402)
at com.pras.IPDParser.parse(IPDParser.java:227)
at com.pras.Main.parseIPD(Main.java:38)
at com.pras.Main.main(Main.java:101)
C:\IPD_Parser_bin1.0\IPD_Parser_bin1.0>pause;
Press any key to continue . . .
Any ideas ?
Thanks !
I also get NegativeArraySizeException just like Anonymous got! Any help will be appreciated!
ReplyDelete