Need help to better understand this and how it works...
What do you consider to be the first and second priority in a sorting algorithm; and justify a key word or phrase to place in the string that is crucial. Provide a short pseudocode example in your discussion post to defend your thoughts. Explain your reasoning for selecting your first and second priorities.
Algorithm: It is a step by step process to solve a particular problem or Task.
Sorting: Arrange the elements either in ascending or descending order.
Priority: Very Important. It will look like as some VIP person/Urgent/Emergency.
Sorting can be classified as two types.
1. Internal Sorting- Bubble sort, Insertion sort, Quick sort1
2. External sorting- Radix/Bucket sort, Merge sort
One of the operation in data structure which plays a role in processing of data is “Sorting” which organizes the records in some logical order, i.e. either in ascending order or in descending order.The main advantage of sorting application is that it requires less time to search for a particular element compared to unsorted list of elements.
We have to perform many attempts made to analyze and reduce the complexity of various algorithm. Also improved sorting algorithms have been proposed to get better efficiency in terms of time and memory. The performance of each sorting algorithm is based on the data being sorted and the machine used for sorting.
The sorting algorithm performs two operations: 1. Compare 2. Swap
The sorting of elements can be done on the basis of priority which we want to display the element first and then remaining list of elements. But the problem arises here is that they are displaying all the records on the basis of priorities, which consumes same amount of time. We are proposing an algorithm which will display required records only as per user’s choice on the basis of priorities and attributes. So, that we can save time.
Advantages:
- Apply priority based sorting on multiple attributes of records.
- Save time on the basis of number of operations.
Algorithm:
1. Insert the List of Elements which you want to sort and assign the priority to each element.
2. Sort the elements on the basis of the Elements order
3. Displays the sorted list of elements.
4. Exit
Pseudo Code:
Input: a collection S storing n elements
Output: the collection S
sorted P = new PQueue()
while !S.isEmpty()
do e = S.removeFirst()
P.insert(e)
while !P.isEmpty()
e = P.removeMin()
S.addLast(e)
INSERTION-SORT(A)
for j ←2 to length[A]
do
key ← A[j]
Insert A[j] into the sorted sequence
A[1 j- 1]. i ← j- 1
while i> 0 and A[i] > key
do
A[i+ 1] ← A[i]
i ← i- 1
A[i+ 1] ← key
The Best example to use this type is Priority Queue with the help of Insertion sort.
Need help to better understand this and how it works... What do you consider to be...
So I'm not sure what I'm trying to do here. I don't understand how *adr works, I guess it's a pointer to the struct Address. How do I complete this function? And how would I have it just return the zip code or one element if I wanted to? I have two structs: struct Address { int number; // street number string street; // street Name string city; // city short zip; // zip code ...
Background: For this assignment, you will write a small encryption utility that implements a simple encryption algorithm described below. The program will take one command line argument as an input; this will represent the word which is to be encrypted. As an output, your program will print the encrypted version of the word to the console using a simple printf() statement. This is the only output your program needs to produce. There is an important catch, however: your program is...
I need help in C++ implementing binary search tree. I have the .h file for the binary search tree class. I have 4 classic texts, and 2 different dictionaries. Classic Texts: Alice In Wonderland.txt A Tale of Two Cities.txt Pride And Prejudice.txt War and Peace.txt 2 different dictionaries: Dictionary.txt Dictionary-brit.txt The data structures from the standard template library can not be used.The main program should open the text file, read in the words, remove the punctuation and change all the...
I NEED HELP WITH THIS HOMEWORK!!!! What is a characteristic of a bag data type? Elements are added and removed in any order Elements are removed in the same order they were added Distinct elements are added in any order but are removed beginning with the last one added Distinct elements are removed in the reverse order they were added Which scenario illustrates a data stack structure Standing in a line to be serviced Filing documents in alphabetical order Offering...
Hello I need help with this program. Should programmed in C!
Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...
1 Overview The goal of this assignment is to help you understand caches better. You are required to write a cache simulator using the C programming language. The programs have to run on iLab machines. We are providing real program memory traces as input to your cache simulator. The format and structure of the memory traces are described below. We will not give you improperly formatted files. You can assume all your input files will be in proper format as...
Need help with this C++ assignment, please use comments so I can better understand your code like comments above your function header explaining what the function does and the purpose of each variable. etc. Assignment: Write a C++ program that reads a text file containing a list of movies "Movie_entries.txt" . Each line in the file contains tile, director, genre, year released and running time of a specific movie. Each field is separated by comma. Print out movie titles sorted...
Have you ever considered how we come to understand the world around us? Think about that question for a minute. What is science, and how do we use it to solve real-world problems? In our first discussion, I want to delve into thinking about the nature of biology. This includes what it is, the major themes, and how we come to form claims or knowledge. You should spend approximately 3 hours on this assignment. Instructions Use the text readings and...
PLEASE HELP WITH A RESPONSE TO MY CLASSMATES DISCUSSION POST BELOW.... I DO NOT NEED ANSWERS TO THE QUESTIONS BELOW, JUST A RESPONSE TO HER POST LIKE AN OPINION ON HER ANSWERS........ THANK YOU! How to communicate an impending company-wide layoff Wide layoffs need a painstaking plan ahead of time in view of the fact that it will affect people’s lives especially their finances. The best channel to convey this type of communication is a vital part to avoid conflicts...
Hey guys I need help with this assignment. However it contains 7
sub-problems to solve but I figured only 4 of them can be solved in
one post so I posted the other on another question so please check
them out as well :)
Here is the questions in this assignment:
Note: Two helper functions Some of the testing codes for the functions in this assignment makes use of the print_dict in_key_order (a dict) function which prints dictionary keyvalue pairs...