answersLogoWhite

0

What are primary data structure?

Updated: 10/25/2022
User Avatar

Wiki User

10y ago

Best Answer

A primary data structure is a data structure that is created without the use of other data structures, whereas a secondary data structure relies on a primary data structure. A data structure is an organized collection of data elements.

[NOTE: Be careful not to confuse the term data structure with the term data type. It is a common mistake. This answer addresses dat structures. Often people who ask about primary data structures or primitive data structures are really asking about primitve data types.]

Here is an example where an array is a primary data structure and a binary tree is a secondary data structure based on the array:

An array is a primary data structure -- it is a set of sequentially numbered data elements, such as an array of integers or an array of names -- name0, name, name2, ...

A binary tree is a data structure where each element (called a node) has a data component and pointers to it's left and right sub-trees. [Think of a directory of folders, but each folder can only have two sub-folders.] We can create an and store an array of nodes to set up the tree in languages like C++ or Java.

The root of the tree could be node 1 in the array, it would point to nodes 2 and 3. node 2 would point to nodes 4 and 5, while node 3 would point to nodes 6 and 7 .. and so on. generally node n point to nodes 2n and 2n+1. (You can start with node 0, but the math is a little easier if you start with node 1.)

The binary tree in this case is the secondary data structure, while the undelying array is the primary data structure.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are primary data structure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

A project report on demographic structure of a neighborhood of 10 families using primary data?

A project report on demographic structure of a neighborhood of 10 families using primary data makes up census data.


Primary data secondary data?

primary data structures


What are primary data and secoundary data?

primary data structures


What are the subject-matters of data structure?

types of data structure types of data structure


How do you amend a data structure?

How do you amend a data structure?


Is the US Constitution primary or secondary data?

it is primary data


What the primary structure of myoglobin?

The amino-acid secquence of myoglobin is the primary structure.


What is homogeneous data structure?

collection of dissimilar type of data is called non homogeneous data structure as for example structure .


What is the difference between allocation and search data structure?

difference between serch data structure and allocation data structure


What is the difference between primary data and secondary data Don't make it complicated please?

The difference between primary data and secondary data is that primary data is the information from the original research.


What is primary data in statistics?

Primary data is is data that has been observed or collected first hand


The most common way to collect primary data is to use a qustionnaire?

While questionnaires are a common method for collecting primary data, other methods include interviews, observations, experiments, and focus groups. The choice of method depends on the research goals, target audience, and resources available. It's important to select the most appropriate method to ensure the accuracy and reliability of the data collected.