Thread: Help require for some data structure topics

1. Help require for some data structure topics

I have to prepare for my paper of Data structure, the problem is that I could not find some topics (Related to questions asked in some old papers) in books and I also searched alot on the web ... but I could not find any helpful link for the topics.
Topics follows...

• A question asked in paper was to differentiate b/w Primitive and Non-Primitive data types. I could only find Primitive data types but could not find Non-Primitve Data types.
• I read book of data structure from start but I could not find Physical and Logical Data structre

Believe me this is not homework...

Help ...

2. hmm
i'm at a lost too

sounds like primitive is comparable to
char theCString[40];

and non primitive is comparable to
string theC__String;

see what i'm getting at?

as for the other stuff i'd have to think for a while.

3. What I have found from a book finding Primitive and Non-Primitive Data types... is Primitive Data Structures

Book Explains about Primitive data structures that ,
The data sturues that typicall are directly operated upon by machine-level instruction

What else I have extracted from 2 more pages after above defination... is that. four basic operations are applied to primitive data strucutres(I think we can call data types... ?)

1. Create
2. Destroy
3. Selection
4. Update.

The writer explained this with the integer variable and real..
The writer has also written that

The four operation just discussed provide us with all the operations that are normall applied to the primitive data structures that will be discussed in the chapter (Integer and Real) In procedure-oriented languages such as Pascal and FORTRAN, a primitive data structure is equated with a simple variable such as a real variable, integer variable, logical variable(I cant understand) etc. A simple variable is assigned a single value such as a real value. The single value associated with a simple variable is referenced through a simple indentifier name such as X

Book: An Introduction to Data structures with Applications
by: Jean-Paul Tremblay and Paul G. Sorenson
Publisher: McGraw Hill
------------------------------
After reading the whole stuff i could not make out any special thing about Primitive data types and Non-Primitive data types..
because next chapters are blank about Non-Primitve data types.
..

4. I thought primitive data types were considered those that are basic to any language, such as char, int and double for ex. Non-primitive data types (structures?) would be those that are built using those primitives, such as lists and stacks. etc..

5. Exactly. Integers, doubles, chars, etc == primitive.
Structures, classes and others == non-primitive.

1. Create
2. Destroy
3. Selection
4. Update.

That is meaningless. These operations can be applied to any data structure.

A physical data structure relates to layout in memory, physical connections, etc.

ie:

struct Packet {
char buff[1000];
//...
char * base = buff;
char * footer = data+ 700;
char * end = buff[999];
};

void MakePacket(struct Packet * p, const char * b){
//...
}

Logical data structures relate to mental layout, and mental connections, etc.

class Network {
List <Packet*> packets;
bool Send(const char * b){
Packet * p = new Packet;
MakePacket(p, b);
Out(p);
//...etc...
}
};

6. Primitives are the datatypes that can't be split, like int and char (as have been mentioned). Structures and classes on the other hand usually consists of int:s and char:s, and are not primitives.

7. Sebastiani and Magos- are correct. We don't call them primative data types in C/C++ but that's what they are called in Java.

As for a book on logical and physical DS check out C++ Data Structures by N. Dale. It talks about DS implementation at the phyiscal and logical levels!

8. Thanxxxxxxx :)

Thanx Thanx... Now I am pretty cleared with my questions...
Thanx again for the help..

9. Primitives and non-primitives depends on the language.
For example a c++ string is not a primative type but
a java String is. Also in lisp, list are primitive types but
in c++ they are not.

10. Primitives and non-primitives depends on the language.
For example a c++ string is not a primative type but
a java String is. Also in lisp, list are primitive types but
in c++ they are not.
Strings are NOT primatives in Java they are objects. Check the JLS
java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#26992

11. Strings are NOT primatives in Java they are objects. Check the JLS
java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html
Just because there're objects
doesn't make them non-primitives. In smalltalk
integers, arrays etc are all objects. The reason why I said
strings in java are primatives is the way it
handles expressions such as
"hello, " + "bye". You cannot reprecate
the strings of java using the java language. In c++
it's possible to define a String that behaves exactly
like the c++ std string. Primatives is kind of a
vague term and probably every book has a different way
of defining it.