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
Sliva [168]
3 years ago
5

Give an efficient algorithm to find all keys in a min heap that are smaller than a provided value X. The provided value does not

have to be a key in the min heap. Evaluate the time complexity of your algorithm
Computers and Technology
1 answer:
viva [34]3 years ago
3 0

Answer:

The algorithm to this question as follows:

Algorithm:

finding_small_element(element,Key xa) //defining method that accepts parameter

{

if (element.value>= xa) //check value

{

//skiping node

return;  

}

print(element.value);//print value

if (element.left != NULL) //check left node value

{

finding_small_element(element.left,xa); //using method

}

if (element.right != NULL) //check right node value

{

finding_small_element(element.right,xa); //using method

}

}

Explanation:

In the above pre-order traversing algorithm a method  "finding_small_element" is defined, that accepts two parameter, that is "element and ax', in which "element" is node value and ax is its "key".

  • Inside this if block is used that check element variable value is greater then equal to 0.
  • In the next step, two if block is defined, that check element left and the right value is not equal to null, if both conditions are true, it will check its right and left value. In this algorithm, there is no extra need for traversing items.
You might be interested in
Choose the word that best completes this sentence. ________ can only grow and multiply within the cells of another living thing,
melomori [17]
The correct answer that would best complete the given statement above would be the word VIRUSES. Here is the complete statement. Viruses can only grow and multiply within the cells of another living thing, but they can remain active on a surface for several hours or days.
4 0
3 years ago
What ip class is this address: 128-191.255.255.255?
defon
Class B would be the correct answer.
4 0
4 years ago
Which best describes how computer simulations are used in science?
xz_007 [3.2K]
Computer simulation is just like training for example before pilot fly plane they got training from computer simulation it's just like video lecture
5 0
3 years ago
To manage OpenLDAP policies over Command Line Interface (CLI), a certain type of file is needed. What is this type of file calle
qwelly [4]

The type of file which is needed to manage OpenLDAP policies over Command Line Interface (CLI) is called: LDIF files.

<h3>What is OpenLDAP?</h3>

OpenLDAP can be defined as a free, open-source version of the Lightweight Directory Access Protocol (LDAP) that was developed in 1993 by the OpenLDAP Project.

Basically, it is the server software implementation of the Lightweight Directory Access Protocol (LDAP).

<h3>The uses of OpenLDAP.</h3>
  • It is used for LDAP database control.
  • It allow end users to browse, create, remove and change data on a LDAP server.
  • It allows end users to manage their passwords and browse through data schema.

In conclusion, LDAP Data Interchange Format (LDIF) file is a type of file which is needed to manage OpenLDAP policies over Command Line Interface (CLI).

Read more on LDAP here: brainly.com/question/25998402

7 0
3 years ago
HOWARD!!!!!! THE PHONE IS RINGING!!!!!!!!!
777dan777 [17]

Answer:

i am confused

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • You are the manager and an employee shows up for his shift dressed inappropriately for work. What should you do?
    14·2 answers
  • Select a classification for File2 so that: Alice can read and write to File2 Bob and Charlie can write to File2, but can't read
    6·1 answer
  • Vitamins and minerals dissolve easily in water.True or false?
    5·1 answer
  • Which of the following is a non timber forest product
    7·1 answer
  • For almost all networks today, including the internet, the communication protocol used is called ____.
    15·1 answer
  • What does Data storage enable a browser to do
    5·1 answer
  • What is meant by the phrase "backing up your data"?
    15·1 answer
  • ---------------is a systematic review of a person’swork and achievements over a recent period, usually leading toplans for the f
    11·1 answer
  • Please help please I will count your answer brainiest if you help!
    8·1 answer
  • In which generation microprocessor was developed short answer of computer science​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!