什么是复合数据类型和数据结构之间的区别? [英] What is the difference between a composite data type and a data structure?

查看:533
本文介绍了什么是复合数据类型和数据结构之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了,在C字符数组是一个复合数据类型,因为它是一个字符序列,但随后在Java中的String是一个类和维基百科说,一类是数据结构,我很困惑。

I read that a character array in C is a composite data type because it is a sequence of characters, but then in Java a String is a class and Wikipedia says that a class is data structure, I am confused.

推荐答案

数据结构是理论计算机科学的一个通用词。用于机器可操纵数据的组织的任何技术可以被认为是一个数据结构。即使是一台机器整数是一种数据结构,因为有不止一种方法,该位可能是间preTED。多数情况下,虽然数据结构是用来指该组织施加到数据的的集合:例如,二进制树,哈希表,扁平阵列或链表。通常当人们谈论的数据结构,他们这样做是在通用术语,而不是针对特定的编程语言。

"Data structure" is a very general term of theoretical computer science. Any technique for the organization of machine-manipulable data can be thought of as a data structure. Even a single machine integer is a data structure, because there's more than one way that the bits could be interpreted. Most often, though "data structure" is used to refer to the organization applied to a large collection of data: for instance, a binary tree, a hash table, a flat array, or a linked list. And usually when people talk about data structures they do it in generic terms, not specific to a particular programming language.

的复合数据类型是一个术语的最先进的C和相关语言的,意思是任何语言数据类型不是机号,更多或更少。复合数据类型的数据结构,但并非所有的数据结构是复合数据类型 - 机号码过于简单是复合数据类型,和一个复杂的数据结构可能被建造出来的若干个的复合材料的数据类型。

"Composite data type" is a term-of-art of C and related languages, meaning "any language data type that isn't a machine number", more or less. Composite data types are data structures, but not all data structures are composite data types -- machine numbers are too simple to be composite data types, and a complex data structure is likely to be built out of several composite data types.

类是面向对象的程序设计语言的一个术语的最先进的,指的是不仅定义数据,而是方法操纵的数据的数据类型。在C ++中,所有类类型是复合数据类型,但并非所有的复合数据类型是类类型(其余均为普通的旧数据,或POD类型)。

"Class" is a term-of-art of object-oriented programming languages, referring to a data type that defines not only data but "methods" for manipulating the data. In C++, all class types are composite data types, but not all composite data types are class types (the others are "plain old data", or "POD", types).

字符串是用于保存的小机整数,不知怎的,重新present文本序列的数据结构中的通用术语。几乎所有的编程语言有一个字符串的一些概念,但是没有两个人是相同的。字符串被定义的数据结构。在C系列,字符串始终是复合数据类型,因为的的机器整数不超过几个字符不够大。在面向对象的编程语言,字符串通常是,但不总是,类类型

"String" is the generic term for a data structure that holds a sequence of small machine integers that somehow represent text. Just about every programming language has some notion of a string, but no two of them are the same. Strings are by definition data structures. In the C family, strings are always composite data types, because a single machine integer is not big enough for more than a few characters. In object-oriented programming languages, strings are usually, but not always, class types.

我希望这至少带您进入混乱的更复杂的层面。

I hope this at least advances you to a more sophisticated level of confusion.

这篇关于什么是复合数据类型和数据结构之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆