473,411 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Data structure problem.....


Hi All,

This is my first to this group. I have a linklist implementation. I
want to put some checks in the implementation code
so that i can detect any problem with the list and capture some data
to prove the problem.

Any suggestion or code fragments are welcome .

Thanks,
Adil

Jul 31 '07 #1
3 1326
ad*******@gmail.com wrote:
This is my first to this group.
Have you read the FAQ yet?
I have a linklist implementation.
I guess you're asking us to take your word for it. OK.
I
want to put some checks in the implementation code
so that i can detect any problem with the list and capture some data
to prove the problem.
What would you consider a "problem with the list"?
Any suggestion or code fragments are welcome .
Yes. Please post some code fragments so we could actually make some
suggestions.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 31 '07 #2
On Jul 31, 6:03 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
adil.m...@gmail.com wrote:
This is my first to this group.

Have you read the FAQ yet?
I have a linklist implementation.

I guess you're asking us to take your word for it. OK.
I
want to put some checks in the implementation code
so that i can detect any problem with the list and capture some data
to prove the problem.

What would you consider a "problem with the list"?
Any suggestion or code fragments are welcome .

Yes. Please post some code fragments so we could actually make some
suggestions.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

Basically, I want to inroduce some sanity checks in
implementation....
I would like to know if I can do that. Also if it is a standard
practice.

Example of these consistency or sanity checks would be
, after adding or deleting a node If I can somehow find that the list
has been corrupted or not.
In case the list got corrupted I would like to capture some
information
regarding the nodes involved in the list corruption.
By corruption I mean if the list got broken or anything bad.

The implementation is based on a fast fail strategy. I would like to
fail in the
implementation as soon as some sanity check failed rather than
continue and corrupt
other data structures if anything goes bad with the list.

Jul 31 '07 #3
On Jul 31, 11:40 pm, adil.m...@gmail.com wrote:
Hi All,

This is my first to this group. I have a linklist implementation. I
want to put some checks in the implementation code
so that i can detect any problem with the list and capture some data
to prove the problem.

Any suggestion or code fragments are welcome .
As others have mentioned it's difficult to give examples without
anything from you to go on, but a try:

LinkedList::clear()
{
// some of your code that clears the list
....
// the end of your code

// Then add something like this:
assert(size() == 0);
}

Aug 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: yee young han | last post by:
I need a fast data structure and algorithm like below condition. (1) this data structure contain only 10,000 data entry. (2) data structure's one entry is like below typedef struct _DataEntry_...
1
by: Da-Breegster | last post by:
Hi. I'm attempting to write a roguelike (think nethack, crawl, angband, tome, adom, and yes, I suppose even rogue) in Perl and I've ran into a problem regarding the data structure for the map and...
4
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system...
11
by: theshowmecanuck | last post by:
As a matter of academic interest only, is there a way to programmatically list the 'c' data types? I am not looking for detail, just if it is possible, and what function could be used to...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
5
by: Alfonso Morra | last post by:
Hi, I am writing a messaging library which will allow me to send a generic message structure with custom "payloads". In many cases, a message must store a non-linear data structure (i.e....
1
by: saleem | last post by:
Dear friends, I am working on the problem which deals with the data management of requests and how should we match the responses for the requests to compare the correct Response. my problem...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
29
by: zoltan | last post by:
Hi, The scenario is like this : struct ns_rr { const u_char* rdata; }; The rdata field contains some fields such as :
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
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...

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.