TopK questions asked during the interview can be answered with such elegance

prefacehello, everyone, I'm bigsai brother. I haven't seen you for a long time. I miss you very much 🤩!Today, I'll share a TOPK problem, but I don't consider a particularly large distributed solution here. It's an ordinary algorithm problem.First, find out what is the topK problem?The topK problem is to find out the number of the first k in th ...

Posted by snowman2344 on Thu, 16 Dec 2021 06:20:55 +0100

[ClickHouse technology series] - nested data structures in ClickHouse

Introduction: This article is translated from Altinity's series of technical articles on ClickHouse. ClickHouse, an open source analysis engine for online analytical processing (OLAP), is widely used by companies at home and abroad because of its excellent query performance, PB level data scale and simple architecture. This series of technical ...

Posted by sirish on Thu, 16 Dec 2021 04:39:41 +0100

Eight sorts of diagrams of "Tianlong eight rows" (idea + realization + summary)

1, Foreword This chapter mainly explains: Basic knowledge and implementation of eight sorting Note: the eight sorts here refer to direct insertion, hill, selection, stacking, bubbling, fast sorting, merging and counting Eight sorting summary charts: 2, Sorting concept and Application 1. Concept Sort: The so-called sorting ...

Posted by srirangam007 on Thu, 16 Dec 2021 02:14:54 +0100

Reverse order pair (merge sort + tree array)

Title Description TOM the cat and JERRY the mouse have been competing again recently, but they are adults after all. They don't like to play the game of chasing each other. Now they like to play statistics. Recently, TOM old cat found something called "reverse order pair" in human class. This thing is defined as follows: for a given ...

Posted by Bricktop on Wed, 15 Dec 2021 23:17:51 +0100

155. Minimum stack force buckle (LeetCode)

55. Minimum stack force buckle (LeetCode) 👉155. Minimum stack force buckle (LeetCode) Topic Description: design push, pop, top and getMin functions, and find the minimum value when the time complexity is O(1) Wrong idea: given a variable to record the minimum value, this idea is wrong, and we should consider the problem more comprehensi ...

Posted by latinofever on Wed, 15 Dec 2021 21:03:11 +0100

Leetcode042 connected to rainwater &039 histogram maximum rectangular area

The maximum rectangular area of rainwater and histogram are two problems that echo each other. There are many similarities in principle, but there are differences in details. Connected to rainwater (monotonous stack) Brute force method (double pointer): Note that after finding the highest column on the left and right sides, it is also ne ...

Posted by cloudnyn3 on Wed, 15 Dec 2021 16:56:50 +0100

Write and share questions every day -- sort linked list / / merge and sort

Title Description: Title Link stamp Problem solving ideas: The advanced problem of the problem requires the time complexity of O(nlogn) and the space complexity of O(1). The sorting algorithm with time complexity of O(nlogn) includes merge sort, heap sort and quick sort (the worst time complexity of quick sort is O(n^2), and the sorting al ...

Posted by liebs19 on Wed, 15 Dec 2021 16:34:52 +0100

Sword finger offer(C++)-JZ35: copy of complex linked list (data structure linked list)

Author: Zhai Tianbao Steven Copyright notice: the copyright belongs to the author. For commercial reprint, please contact the author for authorization. For non-commercial reprint, please indicate the source Title Description: Enter a complex linked list (each node has a node value and two pointers, one pointing to the next node and the other ...

Posted by sgarcia on Wed, 15 Dec 2021 06:12:30 +0100

Problem solving report of 2021CCPC four northeast provinces

2021CCPC northeast four provinces competition A. Matrix General meaning You need to use [ 1 , n 2 ] [1, n^2] All numbers ...

Posted by vijayfreaks on Wed, 15 Dec 2021 05:30:50 +0100

Review the old and know the new -- sequence table of data structure

1, Basic concepts Sequential table is a sequential storage structure of linear table, which uses storage units with continuous addresses to store data elements. Symbolic representation of sequence table: Suppose there are n (n ∈ N) data elements of the same type, and the ith element (1 ≤ i ≤ N) is expressed as ai, then the sequenc ...

Posted by niroshana35 on Wed, 15 Dec 2021 02:18:02 +0100