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
Fofino [41]
2 years ago
12

Draw a flowchart diagram for a program that displays numbers 1 to 20

Computers and Technology
1 answer:
madreJ [45]2 years ago
6 0
Here you go plz mark brainlist
You might be interested in
The
pishuonlain [190]

Answer:

print preview

Explanation: platooo

8 0
2 years ago
Please tell me the answer
777dan777 [17]

Answer:

Here is an image for that.

Explanation:

I hope it'll help.

6 0
3 years ago
Why will the standard replacement algorithms (LRU, FIFO, clock) not be effective in handling this workload for a page allocation
dusya [7]

Answer:

These algorithm keeps an eye on which page was used when. LRU assumes that the page that was recently used has more probability  

of being used or requested by the user. Thus, it keeps the pages that were recently used, when a new page is requested. If page  

fault occurs, the requested page is fetched and it replaces the page in cache which was last referenced earlier than any other page  

in the cache (or frame).The LRU associates a time with each page in the memory and the ones with the greatest value are replaced.  

It does not suffer from Belady’s anomaly. The page fault will be referred when 512 page frame are reached. This is the total length of the complete sequence.

FIFO replaces pages that come in cache firstly. FIFO stands for First in first out.  

(b) The FIFO replacement algorithm replaces the page which was first brought into the memory followed by the next and soon.  

This algorithm suffers from Belady’s anomaly. In First In First out (FIFO) page replacement scheme of page replacement, the requests  

are executed as they are received. When a new request is made of a page which is not available in the existing frames, then the requested  

page is acquired from the memory. The page in the first frame is replaced by the requested page. If again a request is made of a page not  

yet available in the frames, it is fetched from the memory and it replaces the second frame's page, and so on.  

There are total 500 frames given. The alternative approach which is better than clock algorithm, FIFO, and LRU is that the pages  

from 0 to 498 are set to the fixed frames. Thus, 499 frames are fixed and only one frame can vary.

Explanation:

6 0
2 years ago
Portable Document Format (PDF) is a file format that provides an electronic image of a document and can be viewed, printed, and
bogdanovich [222]
True a pdf is a file format that provides a electronic image of a document and it can be viewed, printed and electronically transmitted.
7 0
3 years ago
Read 2 more answers
Write a program that reads numbers from a file (or allow user to input data) and creates an ordered binary tree. The program sho
IgorLugansk [536]

Answer:

See explaination

Explanation:

include<bits/stdc++.h>

using namespace std;

typedef struct Node

{

int data;

struct Node *left,*right;

}Node;

bool search(Node *root,int data)

{

if(root==NULL)

return false;

if(root->data==data)

return true;

queue<Node*> q;

q.push(root);

while(!q.empty())

{

Node *temp=q.front();

q.pop();

if(temp->data==data)

return true;

if(temp->left)

q.push(temp->left);

if(temp->right)

q.push(temp->right);

}

return false;

}

Node *insert(Node *root,int data)

{

if(root==NULL)

{

Node *temp=new Node();

temp->data=data;

temp->left=NULL;

temp->right=NULL;

return temp;

}

if(data < root->data)

root->left=insert(root->left,data);

if(data>root->data)

root->right=insert(root->right,data);

return root;

}

Node *get_smallest_element_right_subtree(Node *root)

{

while(root && root->left!=NULL)

root=root->left;

return root;

}

Node *delete_node(Node *root,int data)

{

if(root==NULL)

return root;

if(data < root->data)

root->left=delete_node(root->left,data);

else if(data > root->data)

root->right=delete_node(root->right,data);

else

{

if(root->left==NULL) //If right only presents means - delete the curr node and return right node

{

Node *temp=root->right;

free(root);

return temp;

}

else if(root->right==NULL) //If left only presents means - delete the curr node and return let node

{

Node *temp=root->left;

free(root);

return temp;

}

else

{

Node *temp=get_smallest_element_right_subtree(root->right);

root->data=temp->data;

root->right=delete_node(root->right,temp->data);

}

return root;

}

}

void inorder(Node *root)

{

if(root!=NULL)

{

inorder(root->left);

cout<<root->data<<" ";

inorder(root->right);

}

}

void postorder(Node *root)

{

if(root!=NULL)

{

inorder(root->left);

inorder(root->right);

cout<<root->data<<" ";

}

}

void preorder(Node *root)

{

if(root!=NULL)

{

cout<<root->data<<" ";

inorder(root->left);

inorder(root->right);

}

}

int main()

{

fstream f;

string filename;

cout<<"\n\n1 - Input through File ";

cout<<"\n\n2 - Input through your Hand";

int h;

cout<<"\n\n\nEnter Your Choice : ";

cin>>h;

Node *root=NULL; // Tree Declaration

if(h==1)

{

cout<<"\n\nEnter the Input File Name : ";

cin>>filename;

f.open(filename.c_str());

if(!f)

cout<<"\n\nError in Opening a file !";

else

{

cout<<"\n\nFile is Being Read ........";

string num;

int value;

int node=0;

while(f>> num)

{

value=stoi(num);

root=insert(root,value);

node++;

}

cout<<"\n\nTree has been successfully created with : "<<node<<" Nodes"<<endl;

}

}

if(h==2)

{

int y;

cout<<"\n\nEnter the Total No of Input :";

cin>>y;

int i=1,g;

while(i!=y+1)

{

cout<<"\n\nEnter Input "<<i<<" : ";

cin>>g;

root=insert(root,g);

i++;

}

cout<<"\n\nTree has been successfully created with : "<<y<<" Nodes"<<endl;

}

if(h>=3)

{

cout<<"\n\nInvalid Choice !!! ";

return 0;

}

int n=0;

while(n!=6)

{

cout<<"\n\n\n1 - Insert Element";

cout<<"\n\n2 - Remove Element";

cout<<"\n\n3 - Inorder (LNR) Display ";

cout<<"\n\n4 - Pre (NLR) Order Display";

cout<<"\n\n5 - Post (LRN) Order Display";

cout<<"\n\n6 - Quit";

cout<<"\n\nEnter Your Choice : ";

cin>>n;

switch(n)

{

case 1:

{

int k;

cout<<"\n\nEnter Element to insert : ";cin>>k;

root=insert(root,k);

cout<<"\n\nElement Sucessfully Inserted !!!!!";

break;

}

case 2:

{

int k;

cout<<"\n\nEnter Element to Remove : ";

cin>>k;

if(search(root,k))

{

root=delete_node(root,k);

cout<<"\n\nValue Successfully Deleted !!!";

}

else

cout<<"\n\n!!!!!!!!!!!!!!!!!!!! No Such Element !!!!!!!!!!!!!!!!!!!!!!";

break;

}

case 3:

{

cout<<"\n\nThe Elements (LNR) are : ";

inorder(root);

break;

}

case 4:

{

cout<<"\n\nThe Elements (NLR) are : ";

preorder(root);

break;

}

case 5:

{

cout<<"\n\nThe Elements (LRN) are : ";

postorder(root);

break;

}

case 6:

{

break;

}

}

}

cout<<"\n\nBye!!!! See You !!!"<<endl;

7 0
3 years ago
Other questions:
  • Most graphics software uses a process called pixel _________ to create new pixels by averaging the colors of nearby pixels.â
    6·1 answer
  • zeroIt is a function that takes one argument and returns no value. The function stores the value 0 back into the parameter. x is
    8·1 answer
  • Why you should care about copyright
    13·1 answer
  • Does Windows 7 support secure boot in UEFI? Windows eight? Linux UBUNTU version 14?
    8·1 answer
  • Using Phyton
    9·1 answer
  • Question 6 of 10
    11·1 answer
  • Please help me here: h t t p s : / / t i n y u r l . c o m / y t 7 r 3 y a m
    13·1 answer
  • 80. A .......... is used to read or write data.<br>A. CD B. VDU C. ROM D. RAM​
    6·1 answer
  • Importance of folders on a computer <br>​
    10·1 answer
  • Question 4 A data analyst wants to include a line of code directly in their .rmd file in order to explain their process more cle
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!