473,667 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

create 3d structure with a linked list?

1 New Member
Hi there,
I have an assignment in which the first part requires me to store coordinates in a .txt file in a linked list data structure.
The text file has coordinates laid out as follows:

1 1 5
1 2 4
1 3 87
1 4 76
2 1 54

etc etc, basically in the form x y z

I need to know how to create a 3d linked list structure to store these, or if this is even the best approach to take! I can't use an array because I don't know how many elements there are.

Once this structure is made I need to implement a local search simulated annealing strategy on it - but that's another problem.

Any help would be greatly appreciated.

Regards,
Chris.
May 5 '09 #1
3 3564
JosAH
11,448 Recognized Expert MVP
You might have a look at an oct-tree data structure.

kind regards,

Jos
May 5 '09 #2
r035198x
13,262 MVP
Perhaps your first step should be to create a Point class with int x,y,z as attributes and then simply put the points into a LinkedList.
May 5 '09 #3
r035198x
13,262 MVP
@JosAH
I also got some fancy ideas when I first read the post. Then I kept re-reading it again and decided that they don't want to display the linked structure at all. Maybe I was wrong but I think this one is one of those very simple ones explained in a complicated manner.
May 5 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3266
by: John | last post by:
Hi all, Can a linked list be a member of a structure? If so, when I add or remove an element from the linked list, the size of the structure will change. Will it cause any problem? Thanks a lot. John
6
2478
by: skgolden | last post by:
My husband and I own a small temporary labor company and deal with 4 major clients (A,B,C & D), each of which has about 2 dozen units in our tristate area that we deal with (ie, Company A, units a,b,c,d,e etc). We send temps possessing various skills (cashier, cook, hostess, etc) to the individual units as needed. What I'm trying to do is create a schedule we can use each day, for example: Monday, June 1, 2004 Company A, unit e Alice...
4
2472
by: Dan | last post by:
I'm trying to creat a data structure, that can be either a integer, double, string, or linked list. So I created the following, but don't know if it is the data structure itself causing problems, or something I am doing in the rest of the program. This is the data structure. struct node { char type;
5
1805
by: Peter | last post by:
I am looking for a data structure that I need to use as follows. Suppose I am looking for node A. When I perform a lookup for node A I also want information about the node previous to node A( as per the lookup data structure ordering scheme). Is there anything that I could use for this. Using a doubly linked list is not looking good as I can have a large number of elements in my linked list. Thanks in advance, Peter
13
7285
by: John | last post by:
In the course of an assignment, I learned the hard way that I shouldn't try to free a malloc'd member of a malloc'd structure after having freed that structure (i.e., free( structure ); free( structure->bufferspace ) ). My question is, if I free just the structure, will the (e.g.) bufferspace be freed implicitly, or do I have to (as I currently am) free the members first? Thanks. -cjl
3
2017
by: bjhecht | last post by:
http://rafb.net/paste/results/tJoB4z75.html After executing the following code I receive the errors: a.c: In function `insert': a.c:59: error: incompatible types in assignment I have no problem when first_name in the structure is an int. I can easily assign a default value in the insert function. But I would like to allow full strings to be sent to the field from the insert function....Any ideas?
19
7816
by: Dongsheng Ruan | last post by:
with a cell class like this: #!/usr/bin/python import sys class Cell: def __init__( self, data, next=None ): self.data = data
15
7781
by: Killer42 | last post by:
Hi all. Ok, I'm using VB6 but I think the answer to this (if there is one) is more likely to be found in the Access forum. I have a situation where I've got tens of millions of records, spread over a bunch of separate databases. I don't have a choice about this, as the data is simply too large for a single MDB. As yet, I'm not prepared to go to SQL Server. Possibly in the not-too-distant future, but we'll see. In the meantime, I have this...
1
6178
by: yaarnick | last post by:
Create a linked list data structure library to hold strings. Then library should support the following linked list operations. Create() – Creates the linked list Insert() – Insert a string into the linked list Delete() – Deletes a string from the linked list Search() – Search for a string and return 1 if found otherwise return 0. isEmpty() – Returns 1 if the list is empty and 0 otherwise. Display() – Display all the strings in the list. ...
0
8458
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8565
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8650
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2779
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.