M180: Data Structure and Algorithms in Java Arab Open University
M180: Data Structure and Algorithms in Java Arab Open University
M180: Data Structure and Algorithms in Java Arab Open University
Data Structures
A data structure is a scheme for organizing data in the memory of a computer. Some of the more commonly used data structures include lists, arrays, stacks, queues, heaps, trees, and graphs.
Binary Tree
Data Structures
The way in which the data is organized affects the performance of a program for different tasks. Computer programmers decide which data structures to use based on the nature of the data and the processes that need to be performed on that data.
Example: A Queue
A queue is an example of commonly used simple data structure. A queue has beginning and end, called the front and back of the queue.
Data enters the queue at one end and leaves at the other. Because of this, data exits the queue in the same order in which it enters the queue, like people in a checkout line at a supermarket.
Each spot on the tree, called a node, holds an item of data along with a left pointer and a right pointer.
Binary Tree
Each move down the tree cuts the remaining data in half.
Lists Arrays
Lists
A list is an ordered set of data. It is often used to store objects that are to be processed sequentially.
Arrays
An array is an indexed set of variables, such as dancer[1], dancer[2], dancer[3], It is like a set of boxes that hold things. A list is a set of items.