Posts

What are trees in Data Structure?

Image
What are Trees in Data Structure? Trees are a type of data structure that represents hierarchical data.   Trees are the type of non-linear data structure that consists of nodes. All the nodes of the trees are connected by an edge. In the linear data structure, the complexity of an operation increases with the increasing size of data. However, in tree data structure you can get quick access to the data which is non-linear.   Trees include various types of data structures and algorithms , which makes the task performance easy and efficient.   Terminologies associated with trees in the data structure are:   ·          Node: A node in Data structure contains a value or a key and pointers to its child nodes. ·          Child node: A child node is connected to its parent node. The left child node has a value smaller than the parent node and the right child node has a value larger than the parent node. ·          Leaf nodes: Leaf nodes are also called extreme nodes. Leaf nodes do no

What is Data Structure and Algorithm?

Image
  Data Structure is the method of collecting and organizing data in an organized way. So, that we can perform different types of operations on these data in a very effective way. Data Structure is a way of rendering data elements in terms of some relationship. Data Structure and Algorithm is a process of better organization and storage of data elements. For example, we have some data which has student’s name with Roll no. Like a student named Rohit and his roll number is 26. Here “Rohit” is of String data type and 26 is of integer data type. We can organize these data as a record lie student record, which will have both students’ names abc their roll number on it. Now we can collect and store the student’s record in a database or file as a data structure. For example “Rohit” 26, “Arman”5, “Sushil” 34.                                          If you know about the concepts of Object-Oriented Programming, then you are aware that class also does the same thing as a data structure.

Types of trees in the data structure.

Image
  The trees in the data structure demonstrate the relationship between nodes with the parent-child hierarchy. That is why trees in the datastructure are also called hierarchic data structures.  Trees are one of the most popular and easiest ways to simplify the problems and do searching and sorting very fast. Trees are considered as one of the most advanced and strongest data structures. A tree in the  data structure is the representation of a non-linear data structure. Arrays, classes, and connected lists can be implemented using trees. Trees are a combination of different nodes. Each node is attached to the edges to describe the relationship.  What are trees? A tree is a type of non-linear data structure that stores the information in a hierarchical form. The trees in data structures are one of the mature and most efficient. Trees are represented in the form of nodes attached to edges.    Properties of trees:   l   Every tree has a specific root node. A root node can cross e

What are arrays in data in Data Structure?

Image
  If you want to make your career in the field of programming, then the first thing you have to learn is the basics of arrays. After that only, you could do the array problem solving questions.                Let us know what an array is.   An array is the collection of elements of the same data type stored at contiguous memory locations   What are the uses of an Array ?   An array is a collection of elements of the same data type and its size sequence is fixed. An array is a derived data type. When we want to store a large amount of data , or access or manipulate a large amount of data, then we use arrays. In an Array all elements have the common name. Arrays work on index numbers. The index of an array starts from 0 and ends with size-1. The collection of the same data type where each element has a separate memory location. An array is static and is a part of linear data structure.     What are the characteristicsof an array ?   Have a look at some of