Back | Reverse | Quick Reply | Post Reply |

data structure problem
Link | by Children of Lilith on 2008-07-26 14:10:46
My programming problem consists of storing a non trivial number structs that contain audio file data (artist, name of song, genre, etc.) in a data structure that is A) easily searchable B) can be search with fuzzy matches (sub strings, capitalization differences) C) can be searched by certain members of the struct D) is relatively efficient
My initial idea was to create a hash table of the song names, and a separate hash table of artists, where each entry in the hash table of artists points to a Tree of songs (that way I cut down on memory usage) but that does away with B. Storing it in a linked list does away with the speed, and a tree has the problem of having to decide which field to sort the songs by (do I determine the ordering in the tree by genre? artist? you see the problem). I'm thinking my best bet is to create multiple trees, one for song titles, one for artists, and so on. However, I don't know of a way to search through a tree efficiently, when you account for the fact that you have to allow for matchies for substrings... any suggestions would be very very much appreciated

Re: data structure problem
Link | by ruyvlopez on 2008-07-27 06:15:47
I only give some hints, not the answer, in order to guide you to develop your program. But due to your case study's description, I only say "First Three Hint", and after you solve the first three hint that's the time I will say the next hints and some given pseudo code as a reference for that program. I don't know what Programming Language you will use for that project, so I grab Visual Basic as my basic pseudo code for that application. If I give the pseudo code for that, try to study it.


Hint 1:
The first thing you will do is to get and identify the Music Tag (example: Artist, Title, Genre, Album) of the MP3, WAV, or any Audio Files in a certain folder using your program (try to make a prototype). Use a Directory List Box to locate the Audio Files. Put the Information Tags that you get in a Grid or any output List Box.

Hint 2:
Due to your description, there is search method that the application perform, so make a input textbox so that when you type a string, the string will match the equivalent information from the ListBox or Grid Data. Use Loop Method for matching the search.

Hint 3:
The problem you just said in performing a search is what you called "fuzzy matches that has sub strings and capitalization differences". Although it is very easy to overcome that. To solve that, get the Ascii Code equivalent of a certain letter. For instance, the Ascii Equivalent of "A" is 65 and the Ascii Equivalent of "a" is 97. So the next step you gonna do is equality of letters (A = a). There is a much more easy to destinquish Caps and non-caps letters, I will answer it after to solve this 3 Hints.


Give some reply to us so that we will know the improvement of your project. ^_^

Re: data structure problem
Link | by Children of Lilith on 2008-07-27 13:13:58
Sorry, I forgot to mention the programming language. C is the programming language, and its not a GUI app, but rather a command line utility, so hints 1 and 2 unfortunately don't help. But hint 3 does help, thanks.

Re: data structure problem
Link | by ruyvlopez on 2008-08-08 07:23:28
You're programming it in C Programming Language as a Consule Application for sorting MP3s or Audio by it's Music Tags. But although it is hard, here is a difinitely a code for checking music tags of a certain audio files. This code is so long and can't be recommended for typing using a consule application but in a DOS Shell GUI form. If you want to do it in using command lines, better check some .DLLs in your DOS OS (if you want to get a DLL as a supporting code) or make your own class in order to your program to identify Music Tags in DOS.

I don't know if this sites will help, but I just see the codes that I just said to you from here a long time ago that gonna help you in your data structure projects.

http://www.planet-source-code.com/

So, what's the status of your project now?

Back | Reverse | Quick Reply | Post Reply |

Copyright 2000-2024 Gendou | Terms of Use | Page loaded in 0.0021 seconds at 2024-12-28 21:47:55