Advertisement

a cool assignment (not asking for answers ;) )

Started by March 29, 2001 09:34 PM
6 comments, last by Mucman 23 years, 10 months ago
I finally got a cool assignment to do (IMO) in my data structures course. Instead of the assignment specs telling us what DS''s to use etc... we got to design our program from the ground up! All we have to do is read a text file and parse the words and put them into a cross reference data type. The only thing we are told we have to use is a tree some where in our program.... Today my prof gave use our test data and I think he read the class very well... the tree that we are most comfortable with right now is a regular binary search tree... so the first word of out test data is "a" . "a" is going to be the root of the tree making our binary search tree looking like a linked list . Time to read up on AVL trees to make it a little more efficient... I know you guys don''t care or anything, but I just am happy to have an interesting assignment where everything isn''t so cut and dry. "You won''t get wise with the sleep still in your eyes." - Neil Peart
"You won't get wise with the sleep still in your eyes." - Neil Peart
i had that class last semester. What I would use are maybe tries or Patricia Trees. Not going to tell ya how to do it though. But we did something very similar.


"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T
Advertisement
I just got an E-mail saying that we won't lose marks for just using a binary search tree, we just have to document why it won't be that inefficient... I think that's sort of lame, but I am gonna try to put in a more advanced tree anyways. I have never heard of a Patricia tree... All we learned in class were AVL, 2-3, and b-trees. I guess I am going to have to do some research ... who would have though learning data structures could be so much fun!

btw, one of the criterion for the assignment is that a word cannot be store in memory more than once... so if "the occurs" 50 times it can only be stored as 1 string. I think I came up with a clever way to do this... my program is working perfectly, I just want to make it better now , now I understand why so many of you say finishing a project is the hardest thing.

"You won't get wise with the sleep still in your eyes." - Neil Peart

Edited by - Mucman on March 29, 2001 11:11:36 PM
"You won't get wise with the sleep still in your eyes." - Neil Peart
You''re right, that''s a good assignment. A standard question I ask in interviews is something along the lines of: "What are the advantages and drawbacks of using linked lists?" You would be suprised at how many people do not know that linked lists are not appropriate for every problem. Understanding how data structures work is the first step; understand which ones to use to solve a problem is much more important.
Your assingment seems like something that I have been assigned to check up on by my school''s invention club. One of the ideas in the pipeline is to make a program that can respond to questions and statements in a humanlike way. I know there are huge research labs dedicated to this kind of thing, and we are not trying to make an ariticial person, just an app that can usually respond in an intelligible manner to a question. To figure out if we can even scratch the surface of this project, I have been voted to make a program that identifies types of sentences and what the words within it are (subject, verb, direct object, etc). I am thinking of using a tree (perhaps it will eventually become a stupid version of a neural net . We have reasoned that a little randomness and basic logic (with a big dictionary), combined with the known words of the question or sentence can be used to create a more-or-less suitable response. I think that even if we fail it will be fun Your project uses the tree in a different manner, but the fact that you could only store the words once makes me think you could do something similar to this with your program quite easily.

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

You are unique. Just like everybody else.

"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

Stoffel, I sent in my resume and if they ask questions like that during the interview I would be set

Yanroy, luckily we don''t actually have to parse anything meaninful , we just have to load all strings (while removing the period at the end of a word) in our DS. The fact that we are programming in JAVA made it easy to store the word only once. If you are interested, shoot me an E-mail and I would love to explain (at least try) to you how it works!




"You won''t get wise with the sleep still in your eyes." - Neil Peart




"You won't get wise with the sleep still in your eyes." - Neil Peart
Advertisement
Yanroy, that sounds pretty cool. I always wanted to try something like that but I''m not sure how I would go about implementing anything. But you''re right, even if it doesn''t work right, it might still be funny to see what it comes up with. If you get a program running, be sure to upload it somewhere so we can see it!

-Ironblayde
 Aeon Software

Down with Tiberia!
"All your women are belong to me." - Nekrophidius
"Your superior intellect is no match for our puny weapons!"
I did something like that a while back. The computer would start from one sentence structure, and would respond to your questions using that sentence structure, then ask you the question back. It would then ask you for the subject, verb, DO, etc. that was in the sentence and add that structure to its vocabulary. Same goes for the questions you asked it. After a while it started looking moderatly intelligent, considering it was only aswering yes and no questions. It was the first significant program I ever did.
VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.

This topic is closed to new replies.

Advertisement