Hiikehiike.hashnode.dev·17 hours agoData Structures in Competitive Programming - HiikeCompetitive programming is like a mental marathon, pushing you to solve complex problems within a tight time frame. One of the key aspects of excelling in this field is mastering data structures, which help you organize and manage data efficiently. L...DiscussDSA
Alissa Lozhkinalissalozhkin.hashnode.dev·Jul 23, 2024How to Initialize an Array in GoAn array is one of the fundamental data structures for programming. By being able to store multiple different values of the same type, arrays are important for maintaining organization and efficiency of data. This post will go through the different w...Discussarray
Tapan Rachchhtapanrachchh.hashnode.dev·Jul 23, 20241636. Sort Array by Increasing Frequencyclass Solution: def frequencySort(self, nums: List[int]) -> List[int]: c = Counter(nums) v = [x[0] for x in sorted(c.items(), key=lambda x:(x[1], -1 * x[0]))] ans = [] for num in v: ans += [nu...Discussleetcode
Arya M. Pathakarya2004.hashnode.dev·Jul 19, 2024Exploring Built-in Container Types in Go: Arrays, Slices, and MapsHey folks! Today, we're diving deep into Go's built-in container types: arrays, slices, and maps. These are fundamental data structures you'll use all the time when coding in Go. Let's break them down, look at how they work, and see some extensive co...Discuss·21 likes·31 readsGo Deep: Mastering Golang FundamentalsGo Language
Sandeep Ranasandrana.hashnode.dev·Jul 20, 2024Best Time to Buy and Sell StockIntroduction Given an array of daily stock prices, determine the maximum profit achievable through a series of transactions. You can buy and sell on the same day, but can only hold one share at a time. The goal is to devise a strategy that maximizes ...Discussdatastructure
Forhad Hossaincodeforhad.hashnode.dev·Jul 16, 2024Extracting Unique Categories from Product Data in JavaScriptIn web development, particularly in e-commerce websites, you often need to handle product data efficiently. One common task is to extract unique categories from a list of products. In this blog post, we'll explore how to achieve this using JavaScript...DiscussJavaScript
Jay Choukseyjayjava.hashnode.dev·Jul 15, 2024Find Pivot IndexIntroduction Today, I tackled another intriguing problem from LeetCode 75: Find Pivot Index. This easy-level question requires an understanding of prefix sums and arrays. The goal is to find the pivot index where the sum of the numbers to the left of...DiscussJava
Riyaz Nabiyullariyaz-blog.hashnode.dev·Jul 15, 2024Data Structures - Java: Syntax, Use Case, Time and Space Complexity1. Arrays Syntax: // Declaration and initialization int[] array = new int[10]; int[] array = {1, 2, 3, 4, 5}; // Accessing elements int element = array[0]; // Modifying elements array[1] = 10; Use Cases: Fixed-size collections, fast access by inde...DiscussDSA-Javadata structures
Anower Hossainanower77.hashnode.dev·Jul 14, 2024Segment Tree-1Segment Tree Basic Node Divide With Segment Tree Node Numbering (Segment Tree) // build (node, begin, end) build (1, 1, N) { L = 2xN, R = (2xN) + 1 // Node Number Calculate mid = (begin + end) / 2 left = (L, begin, mid) left = (R, ...Discuss·91 readssegment-tree
Jay Choukseyjayjava.hashnode.dev·Jul 14, 2024Find the Highest AltitudeIntroduction Today, I tackled an interesting problem from LeetCode 75: Find the Highest Altitude. This easy-level question requires knowledge of arrays and prefix sums. It involves finding the highest altitude reached during a biker's road trip. Let'...DiscussJava