Assume an array of structure is in order by studentID field
of the record, where student IDs go from 101 to 500. Write
the most efficient pseudocode algorithm you can to find the
record with a specific studentID if every single student ID
from 101 to 500 is used and the array has 400 elements.
Write the most efficient pseudocode algorithm you can to
find a record with a studentID near the end of the IDs, say
in the range from 450 to 500, if not every single student
ID in the range of 101 to 500 is used and the array size is
only 300
No Answer is Posted For this Question
Be the First to Post Answer
Is c++ a difficult language?
How can a '::' operator be used as unary operator?
What is polymorphism in c++? Explain with an example?
Can c++ do everything c can?
Why do we need constructors in c++?
A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a C++ program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.
What is flush c++?
What is the role of copy constructor in copying of thrown objects?
What is endl c++?
What is static in c++?
how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing p(inc+) and m(dec-). NOW, i compiled that program and opened it twice (in 2 different windows) and gave twice the same address to it. now look what happen - if i change the value in one "window" of the program, it DOES NOT change in the other! even if they point to the same address in the memory! here is the code snippet: //------------------------------------------------------ #include <stdio.h> //INCLUDE EVERY KNOWN HEADER FILE #include <conio.h> //FOR ANY CASE... #include <iostream.h> #include <dos.h> #include <process.h> main() { int far *ptr; //FAR POINTER!!! long address; char key=0; //A KEY FROM THE KEYBOARD int temp=0; clrscr(); cout<<"Enter Address:"; cin>>hex>>address; //GETS THE ADDRESS clrscr(); (long)ptr=address; temp=*ptr; //PUTS THE ADDRESS IN THE PTR cout<<"["<<hex<<(unsigned long)ptr<<"]="<<*ptr<<" = "<< (char)(*ptr); //SHOWS: [address]=value=ASCII symbol. while (key!=27) //WHILE YOU DONT PRESS ESC. { while(!kbhit()) //WHILE KEY IS NOT PRESSED { if (temp!=*ptr) { temp=*ptr; clrscr(); cout<<"["<<hex<< (unsigned long)ptr<<"]="<<*ptr<<" = "<<(char)(*ptr); }; //IF THE VALUE HAS CHANGED, CLEAR THE SCREEN AND SHOW //AGAIN if (key=='p') {key=0; (*ptr)++; } //INCREMENT VALUE if (key=='m') {key=0; (*ptr)--; } //DEC. VALUE }; key=getch(); //IF A KEY IS PRESSED, READ IT FROM THE //KEYBOARD }; return 0; //IF ESC WAS THE KEY, EXIT THE PROGRAM } //---------------------------------------------------------
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.