Skip to main content

12 docs tagged with "arrays"

View All Tags

Arrays - Bubble Sort in DSA

Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. The algorithm, which is a comparison sort, is named for the way smaller elements 'bubble' to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems even when compared to insertion sort. It can be practical if the input is usually in sort order but may occasionally have some out-of-order elements nearly in position.

Arrays - Insertion Sort

Insertion Sort is a simple sorting algorithm that builds the final sorted array one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.

Arrays - Selection Sort in DSA

Selection Sort is an in-place comparison sorting algorithm that divides the input list into two parts: the sublist of items already sorted and the sublist of items remaining to be sorted. It repeatedly finds the minimum element from the unsorted part and puts it at the beginning of the unsorted part. The algorithm maintains two subarrays in a given array. The subarray which is already sorted and the remaining subarray which is unsorted. In every iteration of selection sort, the minimum element from the unsorted subarray is picked and moved to the sorted subarray.

Arrays in Data Structures and Algorithms

An array is a collection of items stored at contiguous memory locations. It is a data structure that stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.

Arrays in Java

In this tutorial, we will learn about arrays in Java. We will learn about what arrays are, how to declare and initialize arrays, how to access elements in an array, and how to use arrays in Java.

Arrays in JavaScript for Beginners

In the JavaScript programming language, arrays are used to store multiple values in a single variable. In this section, you will learn how to create and manipulate arrays in JavaScript. You will also learn about the different methods that can be used to manipulate arrays. We are going to cover the following topics in this section:

Sorting and Searching Arrays

In this tutorial, we will learn how to sort and search arrays in Java. We will learn how to sort arrays using the Arrays class and how to search arrays using the Arrays class and the Arrays.binarySearch method.

The Basics of C++ Arrays

In this tutorial, we will cover the basics of C++ arrays. We'll explore how to declare, initialize, and access elements in arrays, as well as discuss multidimensional arrays. By understanding the fundamentals of C++ arrays, you'll be equipped to work with collections of data efficiently and effectively in your programs.

Two-Dimensional Arrays

In this blog post, we'll delve into the world of two-dimensional arrays, a vital data structure in programming. You'll learn what 2D arrays are, how to initialize and traverse them, and their common uses in real-world applications like matrix operations, image processing, and game boards. We'll also tackle classic algorithmic challenges involving 2D arrays, such as rotating a matrix and finding the largest sum subgrid. By the end, you'll have a solid understanding of how to effectively use 2D arrays to solve complex problems in your programming projects.

Using Arrays and Collections

In this tutorial, we will learn how to use arrays and collections in Java. We will learn how to declare, initialize, and access elements in arrays. We will also learn how to use collections, such as ArrayLists, in Java.

Working with Arrays and Collections

In this tutorial, we will learn how to work with arrays and collections in Java. We will learn how to declare, initialize, and access elements in arrays. We will also learn how to use collections, such as ArrayLists, in Java.