logo

Quick Sort Assignment 2022

   

Added on  2022-10-17

16 Pages1682 Words22 Views
Running head: Quick Sort 1
Assignment

Student

Course

Instructor

Date

QUICK SORT 2
Quick Sort

Java is one of the most popular and widely used programming languages. It is also a
platform which is used by various applications to develop and run programs written in any
programming language. Java provides many important features like speed, platform
independence, security, and so on. Java is widely used to develop and run web applications,
scientific supercomputers, gaming consoles, cell phones, and various other areas of the internet.
(GeeksforGeeks, 2019)

A data structure is a method for storing and organizing data on a computer system so that
it can be used easily and efficiently. Furthermore, it is a specialized format by which the data can
be stored, processed, and retrieved. A data structure is usually selected or designed for the
purpose of working on it with algorithms. Therefore, these are very essential for managing large
amounts of data, such as information kept in databases. (javatpoint, 2019)

However, quick sort is one of the most efficient sorting algorithms and it is based on a
divide and conquer algorithm. The input array is divided into smaller arrays in each step. The
name of this algorithm itself denotes that it can sort a list of data elements considerably faster as
compared to the other sorting algorithms. (InterviewBit, 2019)

A pivot element is chosen in quick sort and the left side of the pivot contains all the
elements that are less than the pivot element whereas the right side will contain all the elements
greater than the pivot component. (HackerEarth, 2019)

Person.java Program

QUICK SORT 3
public class Person {

private String firstName;

private String lastName;

private int age;

public Person(String firstName, String lastName, int age) {

super();

this.firstName = firstName;

this.lastName = lastName;

this.age = age;

}

public String getFirstName() {

return firstName;

}

public String getLastName() {

return lastName;

}

public int getAge() {

return age;

QUICK SORT 4
}

@Override

public String toString() {

return firstName +" "+ lastName + " [" + age + " years]";

}

}

Queue.java programming

import java.util.ArrayList;

import java.util.List;

public class Queue {

private Person[] queue;

public Queue()

{

this.queue=new Person[0];

}

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Quick Short Assignment 2022
|16
|1651
|15

Algorithm and Programming Overview | Characteristics and IDE Analysis
|33
|6268
|63

PriorityThreadQueue and ListManager
|4
|670
|24

Efficient and Debugged Java Program for IDSearch
|4
|1456
|442

Design Documentation Program Algorithm
|15
|2080
|86

Source codes for Maximum Flow Algorithm
|9
|913
|366