Write the applications of heap. Answer:- page 84 The stack and heap are used in function calls. When we allocate memory dynamically in our programs, it is allocated from the heap. The use of priority queue with the help of heap is a major application. The priority queue is itself a major data structure, much-used in operating systems.

Author: | Teran Dourr |

Country: | Vietnam |

Language: | English (Spanish) |

Genre: | Personal Growth |

Published (Last): | 6 August 2014 |

Pages: | 254 |

PDF File Size: | 10.27 Mb |

ePub File Size: | 13.71 Mb |

ISBN: | 711-9-35055-812-6 |

Downloads: | 44430 |

Price: | Free* [*Free Regsitration Required] |

Uploader: | Dainos |

Write the applications of heap. Answer:- page 84 The stack and heap are used in function calls. When we allocate memory dynamically in our programs, it is allocated from the heap. The use of priority queue with the help of heap is a major application. The priority queue is itself a major data structure, much-used in operating systems.

Similarly priority queue data structure is used in network devices especially in routers. Heap data structure is also employed in sorting algorithms. For this purpose, it is essential to remember which element belongs to which set. We know that the elements in a set are unique and a tree is used to represent a set. Each element in a tree has the same root, so the root can be used to name the set. The item number in the root will be unique as the set has unique values of items.

We use this root as the name of set for our convenience. Otherwise, we can use any name of our choice. So the element in the root the number is used the name the set. The find operation will return this name. Due to the presence of many sets, there will be a collection of trees.

In this collection, each tree will be representing one set. If there are ten elements, we will have ten sets initially. Thus there will be ten trees at the beginning. In general, we have N elements and initially there will be N trees.

Each tree will have one element. Thus there will be N trees of one node. Now here comes a definition for this collection of trees, which states that a collection of trees is called a forest.

The trees used for the sets are not necessarily binary trees. That means it is necessary that each node should have a maximum of two children nodes. Here a n may have more than two children nodes. To execute the union operation in two sets, we merge the two trees of these sets in such a manner that the root of one tree points to the root of other. So there will be one root, resulting in the merger of the trees.

In the find operation, when we call find x , it helps us to know which set this x belongs to. Internally, we find this x in a tree in the forest. When this x is found in a tree the find returns the number at root node the name of the set of that tree. Answer: Page Yes it is an equivalence relation First rule is reflexive i. Suppose that x is Haris so Haris R Haris. This is true because everyone is related to each other. Second is Symmetry: for all elements x and y, x R y if and only if y R x.

Suppose that y is Saad. If two persons are related, the relationship is symmetric i. Therefore if Haris is brother of Saad, then Saad is certainly the brother of Haris. The family relationship is symmetric. This is not the symmetric in terms of respect but in terms of relationship. Suppose x is Haris, y is Saad and z is Ahmed. This is also true in relationships.

If you are cousin of someone, the cousin of that person is also related to you. He may not be your first cousin but is related to you. In this process, each cell of the memory not only contains the value of the element but also the information where the next element of the list is residing in the memory.

It is not necessary that the next element is at the next location in the memory. It may be anywhere in the memory. We have to keep a track of it. Thus, in this way, the first element must explicitly have the information about the location of the second element. KHalid Hassan on February 18, at am kia ye question past papers me se liye gye hen??? Jahanzaib Ashiq on February 18, at pm g kuch 2,4.

MAGIJA CROWLEY PDF

## Data Structures (CS301)

Grot Programming assignment 1 is available. The practice final is available. The first part of Programming Assignment 4 is available. This course also introduces you to a UNIX-based platform for programming. All designs and code used for programming projects should be the work of only the student submitting the project. The students of this College strucgures that having collective and individual responsibility for the ethical welfare of their peers exemplifies a commitment to the community. Specific Educational Objectives of the Course: Students who submit materials that are products of their own minds demonstrate respect for themselves and the community in which they study.

BURIED TREASURE RABBI DANIEL LAPIN PDF

## CS301_Handouts- Data Structure

Dozilkree Homework 8 will not be due until Wednesday because the final midterm question about Binary Search will be completed in class on Monday. Chap 9 Chap Homework 1 is available. In this course you will learn the answer to this question through the exploration of methods of storing data using data structures. How does a search engine process a query and return results in less than a second? I recommend you go over these problems if you are still unsure about addresses.

BERNETTE 720 MANUAL PDF

## CS301 HANDOUTS PDF

.

APOSTILA ZOONOSES PDF

## 4 Comments

.