Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-20-2007, 11:57 PM
Nichie's Avatar   
Nichie Nichie is offline
Newbie
 
Join Date: Mar 2007
Posts: 2
Rep Power: 0
Nichie is on a distinguished road
Default Need help getting started

Hello, I would like to seek some help on a programming assignment I am doing. I have been programming for roughly a year or so. When I made it to my Data Structure class I feel like I've hit a wall. The class moves very fast and it's really hard for me to catch up since I am still trying to understand a lot of the key concepts from my previous classes. I would really appreciate it if somebody could point me towards the right direction and give me tip and advices overall. Also, by no means am I asking for someone to do the assignment, but rather, give me some ideas on how I should tackle the problem.

Quote:
In this assignment I am to construct a "dictionary ADT" in which key values are mapped to associated data items. The program is designed to count the numbers of occurrences of every word in a large text file. A WordCount ADT will keep track of word/count pairs, and supports the following operations:

- void increment (string key); - this method search for the word "key" -- if it finds the word, it increments the count associated with that word, and if it doesn't find the word, it must insert the word into our data structure and initialize the count for that word to 1.

- void print () - This method prints out all the word/count pairs that are stored in the data structure.

Also, I must implement the WordCount ADT in three different ways:

1. A simple linked list: All new insertions should be made at the front of the list, and nodes never change position in the list.

2. A linked list with the "move-to-front" heuristic: Like implementation 1, but every time a word is accessed in the increment() method it is moved to the very beginning of the linked list.

3. A Binary Search Tree: A simple binary search tree implementation, where you don't worry about keeping the tree balanced at all. Just insert items where they belong in your tree.

In particular, I need to make a clean interface that is common to all implementations, and the program should be written to use the interface. Should be able to switch out the three different implementations just by changing one line in the main program.
I really need help on getting started on this program since I have never done anything like this before. Should I be using a template? What does it mean to be able to switch out the three implementations by changing a line in the main program? What's the best way to do the implementation?

Please forgive my total newbness, I must apologize in advance since I will be asking a lot of noob questions. But I must understand these and I really would appreciate your help.

Chris
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-22-2007, 12:17 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,418
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

Switching implementations can be done by having seperate header and implementation files, and changing which header you include.

Whether you use a linked list or a binary tree, you will need to have nodes that store the information. Start by thinking about what the nodes should contain in each case. After that, think about how to implement the increment and print methods, along with any supporting private methods that may need to be added.

BTW, if you're in a data structures class, you've already gone beyond the status of noob.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java:Tutorial - Getting Started John Java Tutorials 7 10-23-2008 03:14 PM
New programmer needs help getting started mroz C and C++ 1 06-30-2007 10:30 AM
No download but error Jeroen66 ionFiles 11 06-27-2007 08:42 AM
See I haves started a codecall.net thread in mylot... littlefranciscan The Lounge 3 01-29-2007 01:45 PM
Were should I get started. elfshadow14 General Programming 10 09-21-2006 08:52 PM


All times are GMT -5. The time now is 02:13 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads