1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Svetradugi [14.3K]
3 years ago
12

After class a student asked why you would ever use a heap instead of a binary search tree. Provide a good explanation for why an

d when you would.
Computers and Technology
1 answer:
sertanlavr [38]3 years ago
5 0

Answer:

Heap is useful when you want to find max/min element in the given list

BinarySearchTree is used if you need sorted elements of the list

Explanation:

Heap is Good at finding Min/Max and it's time complexity is  (O(1)), while BST is good at all finds (O(logN)). Insert is O(logN) for Heap and BSTstructures..

Max Heap ensures that elements on higher levels are greater than elements at lower level

MinHeap ensures that elements on higher levels are lesser than elements at lower level

BST gives sorted elements by following order (left,root,right).If we want sorted elements we can go with BST

You might be interested in
Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a pr
madreJ [45]

Answer:

Visual.

Explanation:

Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a process called visual programming.

A visual programming language is also commonly referred to as graphics user interface builder (GUI builder) and can be defined as a programming tool that avails programmers the ability to develop software programs (applications) using graphical elements and figures rather than texts alone.

Some examples of visual programming language are executable UML, Blockly, Kodu, Alice, Lego mindstorms, Gamemakers etc.

6 0
3 years ago
6 The part of the computer that contains the brain or central processing unit is also known as the ?
Olin [163]
Answer:  "CPU" .
________________________________
4 0
3 years ago
What is an example of Big Data?
Y_Kistochka [10]

Answer:

providing real-time data feeds on millions of people with wearable devices

Explanation:

6 0
3 years ago
If the ____________ is broken on a laptop, chances are other parts are also broken.
ella [17]
Central processing Unit
8 0
3 years ago
unittttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
alukav5142 [94]
What the hell is the point of this, just to waist people's time?
5 0
3 years ago
Other questions:
  • Write a function called ReverseLetters that takes an input phrase consisting of a single word and reverses the sequence of lette
    15·1 answer
  • If a security officer is non-commissioned officer, he can carry a baton on duty if he went through a training class
    8·1 answer
  • The part of the computer that provides access to the internet is the?
    14·1 answer
  • Incident damage ____ is the rapid determination of the scope of the breach of the confidentiality, integrity, and availability o
    6·1 answer
  • Create a class named CarRental that contains fields that hold a renter's name, zip code, size of the car rented, daily rental fe
    13·1 answer
  • Software for creating animations
    15·2 answers
  • While speech recognition can operate without any confi guration, you can train it to more accurately recognize your voice. true
    5·1 answer
  • Choose the type of error described.
    12·1 answer
  • 1.What is the output of the following program? [10 Marks]namespace ConsoleApp1{class Program{static void Main(string[] args){int
    13·1 answer
  • How to add links in HTML? ​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!