Definition
A data structure is a data organization, management, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.
Data Types and Their Relationship With Data Structures
To answer the question of what is data structure, there are three basic data types to understand.
Ø Abstract.
Abstract data is defined by how it behaves. This type encompasses graphs, queues, stacks, and sets.
Ø Composite (or Compound).
Composite data comprises combined primitive data types and includes arrays, classes, records, strings, and structs. They may also consist of other composite types.
Ø Primitive.
Primitive data is classified as basic data and consists of Boolean, characters, integers, pointers, and fixed- and floating-point numbers.
These data types are the building blocks of data structures.
What Are the Classifications of Data Structure?
Ø Linear and Nonlinear.
Linear structures arrange data in a linear sequence, such as found in an array, list, or queue. In nonlinear structures, the data doesn’t form a sequence but instead connects to two or more information items, like in a tree or graph.
Ø Static and Dynamic.
As the term implies, static structures consist of fixed, permanent structures and sizes at compile time. The array reserves a set amount of reserve memory set up by the programmer ahead of time. Dynamic structures feature non-fixed memory capacities, shrinking or expanding as required by the program and its execution requirements. Additionally, the location of the associated memory can change.
Ø Homogenous and Non-Homogenous.
Homogenous data structures consist of the same data element type, like element collections found in an array. In non-homogenous structures, the data don’t have to be the same type, such as structures.
The Different Data Structure Types
So far, we have touched on data types and data structure classifications. Our walk through the many elements of data structures continues with a look at the different types of data structures.
Ø Array.
Arrays are collections of data items that are of the same type, stored together in adjoining memory locations. Each data item is known as an “element.” Arrays are the most basic, fundamental data structure. Aspiring Data Scientists should master array construction before moving on to other structures such as queues or stacks.
Ø Graphs.
Graphs are a nonlinear pictorial representation of element sets. Graphs consist of finite node sets, also called vertices, connected by links, alternately called edges. Trees, mentioned below, are a graph variation, except the latter has no rules governing how the nodes connect.
Ø Hash Tables.
Hash tables, also called hash maps, can be used as either a linear or nonlinear data structure, though they favor the former. This structure is normally built using arrays. Hash tables map keys to values. For example, every book in a library has a unique number assigned to it that facilitates looking up information about the book, like who has checked it out, its current availability, etc. The books in the library are hashed to a unique number.
Ø Linked List.
Linked lists store item collections in a linear order. Each element in a linked list contains a data item and a link, or reference, to the subsequent item on the same list.
Ø Stack.
Stacks store collections of items in a linear order and are used when applying the operations. For example, the order could be “first in, first out” (FIFO) or “last in, first out” (LIFO).
Ø Queue.
Queues store item collections sequentially like stacks, but the operation order must be “first in, first out” only. Queues are linear lists.
Ø Tree.
Trees store item collections in an abstract hierarchy. They are multilevel data structures that use nodes. The bottom nodes are called “leaf nodes,” while the topmost node is known as the “root node.” Each node has pointers that point to adjacent nodes.
Ø Trie.
Not to be confused with a Tree, Tries are data structures that store strings like data items and are placed in a visual graph. Tries are also called keyword trees or prefix trees. Whenever you use a search engine and receive autosuggestions, you’re witnessing the trie data structure in action. subsets of another.
For More Information:
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com
Comments