Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Data Structures and Algorithms: Sorting Techniques, Hashing, Memory Management, and Queues, Quizzes of Data Structures and Algorithms

Various data structures and algorithms including sorting techniques such as bubble sort, quick sort, insertion sort, selection sort, merge sort, and heap sort. It also discusses linear hashing, memory management with avl trees and memory leaks, precision, queue implementation, and internal storage representation in rdbms using b+ trees. Additionally, it explains the minimum number of queues needed for priority queues and the concept of pointers.

What you will learn

  • When is balancing necessary in an AVL tree?
  • What causes a memory leak and how can it be prevented?
  • What is the best sorting algorithm and why?
  • How does linear hashing work?
  • What is the significance of precision in data?

Typology: Quizzes

2021/2022

Uploaded on 07/04/2022

johnny-test-1
johnny-test-1 🇮🇳

3 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Data Structures
1) What are the various kinds of sorting techniques? Which is has best case?
Ans: Bubble sort, Quick sort, Insertion sort, Selection sort, Merge sort, Heap sort. Among
the sorting algorithms quick sort is the best one.
2) What is linear hashing?
Ans: In linear hashing, the table is gradually expanded by splitting the buckets in order
until the table has doubled its size.
3) When can you tell that a memory leak will occur?
Ans: A memory leak occurs when a program loses the ability to free a block of
dynamically allocated memory.
4) In an AVL tree , at what condition the balancing is to be done?
Ans: If the balance factor of any node is other than 0 or 1 or -1 then balancing is done.
5) What is precision?
Ans: Precision refers the accuracy of the decimal portion of a value. Precision is the
number of digits allowed after the decimal point.
6) How is the front of the queue is calculated?
Ans: The front of the queue is calculated by front = (front+1) % size.
7) In RDBMS, what is the efficient data structure used in the internal storage
representation?
Ans: B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes
searching easier. This corresponds to the records that shall be stored in leaf nodes.
8) Minimum number of queues needed to implement the priority queue?
Ans: Two. One queue is used for actual storing of data and another for storing priorities.
9) Is Pointer a variable?
Ans: Yes, a pointer is a variable and can be used as an element of a structure and as an
attribute of a class in some programming languages such as C++, but not Java. However,
the contents of a pointer is a memory address of another location of memory, which is
usually the memory address of another variable, element of a structure, or attribute of a
class.
10) Name two desirable properties of hashing functions.
Ans: Some of the desirable properties of a hashing function are speed and the generation
of addresses uniformly.
From: Sushanth Bhat,
Team No.2,
4NM07CS125
pf2

Partial preview of the text

Download Data Structures and Algorithms: Sorting Techniques, Hashing, Memory Management, and Queues and more Quizzes Data Structures and Algorithms in PDF only on Docsity!

Data Structures

  1. What are the various kinds of sorting techniques? Which is has best case? Ans: Bubble sort, Quick sort, Insertion sort, Selection sort, Merge sort, Heap sort. Among the sorting algorithms quick sort is the best one.
  2. What is linear hashing? Ans: In linear hashing, the table is gradually expanded by splitting the buckets in order until the table has doubled its size.
  3. When can you tell that a memory leak will occur? Ans: A memory leak occurs when a program loses the ability to free a block of dynamically allocated memory.
  4. In an AVL tree , at what condition the balancing is to be done? Ans: If the balance factor of any node is other than 0 or 1 or -1 then balancing is done.
  5. What is precision? Ans: Precision refers the accuracy of the decimal portion of a value. Precision is the number of digits allowed after the decimal point.
  6. How is the front of the queue is calculated? Ans: The front of the queue is calculated by front = (front+1) % size.
  7. In RDBMS, what is the efficient data structure used in the internal storage representation? Ans: B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes.
  8. Minimum number of queues needed to implement the priority queue? Ans: Two. One queue is used for actual storing of data and another for storing priorities.
  9. Is Pointer a variable? Ans: Yes, a pointer is a variable and can be used as an element of a structure and as an attribute of a class in some programming languages such as C++, but not Java. However, the contents of a pointer is a memory address of another location of memory, which is usually the memory address of another variable, element of a structure, or attribute of a class.
  10. Name two desirable properties of hashing functions. Ans: Some of the desirable properties of a hashing function are speed and the generation of addresses uniformly. From: Sushanth Bhat, Team No.2, 4NM07CS