answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

Difference between ordered and unordered list?

unordered list: delineates a list, where the items are generally of equal importance and do not need to go in any particular order. Each item begins with a tag. Unordered lists may be nested inside unordered lists or inside any other types of lists (one list inside of another list inside of another list). A line space automatically is inserted before and after an unordered list (that is, an entire line is skipped between an unordered list and any text before and after it), except for (on most browsers) a list nested within another list.ordered list: delineates a list, where the items are in sequential, numerical order. Each item begins with a tag. Ordered lists may be nested inside ordered lists or inside any other types of lists (one list inside of another list inside of another list). A line space automatically is inserted before and after an ordered list (that is, an entire line is skipped between an ordered list and any text before and after it), except for (on most browsers) a list nested within another list.


What is linear search algorithm?

The linear search problem relates to searching an un-ordered sequence. Because the data is no ordered, we must start at one end of the sequence and inspect each element in turn tunil we find the value we are looking for. If we reach the one-past-the-end of the sequence, the value does not exist. From this we can see that for a set of n elements, the worst case (the element does not exist) is O(n) time while the best case is O(1) time (the element we seek is the first element). Given that there is a 50/50 chance the element we seek will be closer to the start of the sequence than the end, the average seek time is O(n/2). When a set is ordered we can reduce search times by starting in the middle of the set. In this way, if the element is not found we can eliminate half of the set because we know which half contains the value (if it exists). We repeat the process until we find the value in the middle of the remaining set or the remaining set is empty. The end result is that search times are reduced to a worst case of O(log n), the binary logarithm of n.


Difference between HashSet and Linkedhash set in java?

The only difference is that the LinkedHashSet maintains the order of the items added to the Set. It does this by maintaining a doubly linked list containing the hash and the original order of the items. According to Sun, the LinkedHashSet should run nearly as fast as the HashSet.LinkedHashSet A LinkedHashSet is an ordered version of HashSet thatmaintains a doubly-linked List across all elements. Use this class instead of HashSetwhen you care about the iteration order. When you iterate through a HashSet theorder is unpredictable, while a LinkedHashSet lets you iterate through the elementsin the order in which they were inserted.HashSet A HashSet is an unsorted, unordered Set. It uses the hashcodeof the object being inserted, so the more efficient your hashCode() implementationthe better access performance you'll get. Use this class when you want a collectionwith no duplicates and you don't care about order when you iterate through it.


Difference between list and set in java?

A List is an ordered collection of elements. A Set is a collection of unique elements. Sets should be used when you want to store objects without duplicates. Lists should be used any time you need to store an unknown number of objects.


What are the different types of array explain with examples?

There are two main types of array:1) Single dimensional array: These are arrays for which only one index is required to access the element stored in an array. They are stored in a contiguous memory location.Eg:int arr[10];//declarationarr[7] = 7;//initialization2) Multidimensional array: These are arrays for which more than one index is required to access the element stored in a specific location in the array. These are stored in a contiguous memory location row-by-row.Eg:int arr[5][5];//two dimensional arrayint arr[5][5][5];//three dimensional array

Related Questions

What is a example of a array?

An ordered array is simply an array where all elements are in sorted order: int a[] = {3, 6, 9, 10, 15, 21}; // ordered array An array can either be initialised with ordered elements or the elements may be sorted after initialisation. When inserting new elements into an ordered array, the order must be maintained.


How are the elements in the modern periodic arranged?

The elements are ordered by their mass number.


How are the elements organized into the periiodic table?

Elements are ordered by atomic number.


Elements are ordered by their atomic numbers?

ya


Can elements be ordered by there atomic number?

Yes, elements can be ordered by their atomic number. The atomic number of an element corresponds to the number of protons in an atom's nucleus, and elements are arranged in the periodic table from lowest to highest atomic number.


Why are the elements ordered as they are in the period table?

Number of protons.


What are the first numbers in an ordered pair?

They are the elements from the first set in the original Carestian product. For example, if you make ordered pairs on an x-y plane, then they are the elements of the set X.


Are elements are ordered by their atomic number on the periodic table?

Yes.


Elements are ordered according to what?

average atomic mass number


A set of two elements in which the order is specified?

It is called an ordered pair.


What ordered all payments for federal land to be made in gold or silver?

Andrew Jackson in 1836, It was called the Specie Circular


What are the set of ordered pairs for y equals 0.1 x plus 1?

They are elements of the infinite set of ordered pairs of the form (x, 0.1x+1). It is an infinite set and I am not stupid enough to try to list its elements!