Divide and Conquer and Recursive-Find the Number of k Near Medians
Problem Description: Given the set S consisting of n different numbers and the positive integer k < n, we try to design an O(n) time algorithm to find the number of K that is closest to the median of S.
Algorithmic description:
Finding the Median with the Algorithms Realized by Linear Time Selection
S'= S excluding median
Value in S"=| ...
Posted by brax23 on Sun, 03 Feb 2019 09:03:17 -0800
Linked list: Create a simple linked list and output its contents
Professional terms for lists:
The first node: the node that stores the first valid dataTail node: the node that holds the last valid dataHead Node:1. The data type of the header node is identical to that of the header node.2. The header node is the node in front of the header node.3. Header nodes do not store valid data4. The purpose of setting ...
Posted by fitzromeo on Sat, 02 Feb 2019 13:21:15 -0800
C Language Learning Records (3)
C Language Learning Records
C Language Practice on Mooc
Read integer
Topic:
Your program reads an integer in the range of [- 100,000,100,000]. Then, each bit of the integer is output in Pinyin.
If input 1234, output:
yi er san siNote that there is a space between the Pinyin of each word, but there is no space behind the las ...
Posted by pagie on Sat, 02 Feb 2019 02:30:16 -0800
python basic learning notes (1)
It's better to have a c++ basis. Update one article every day.
This is a basic article.
1. operator2. variable3. Basic Input and Output4. string5. list6. tuple7. dictionary8. set9. Simply talk about the cycle or something.
1. operator
Special
a / b: Floating point number, a // b is an integer, discarding fraction a**b is the B power of a
And c ...
Posted by kinaski on Fri, 01 Feb 2019 13:00:15 -0800
Android JNI Development Series (11) JNI Access Parent Class Construction Method and Parent Class Instance Method
JNI Access Parent Class Construction Method and Parent Class Instance Method
Constructing Method and Parent Class Instance Method
Let's start with a piece of Java code.
Java package org.professor.jni.animal;
import android.util.Log;
public class Animal {
protected String name;
public Animal(String name) { this.name = name; }
public St ...
Posted by fallenangel1983 on Fri, 01 Feb 2019 10:15:15 -0800
QNYGKit-iOS Dynamic Layout Framework Based on Yoga
QNYGKit
iOS Dynamic Layout Framework Based on Yoga.
QNYGKit framework github address
What is Yoga?
Yoga is a cross-platform layout engine that implements Flexbox specification. It is implemented in c language with high efficiency.
What is FlexBox?
flexible box modules (currently recommended as w3c candidates) are designed ...
Posted by Vebut on Mon, 28 Jan 2019 08:12:15 -0800
C oroutine
Donald Knuth said:
"A subroutine is a special case of a protocol."
In the process of programming, the most commonly used is the function call. At this time, for the caller, the called function is subroutine. It is possible to understand the functions that cooperate with each other. Functions can be switched between e ...
Posted by BillyB on Sun, 27 Jan 2019 15:42:14 -0800
String connection in serial communication.
IntroductionWhen debugging serial communication, a problem arises, that is, how to realize the connection of two strings in C language. The first reaction is that this is not easy, just use strcat, who knows that with in-depth study, found some problems that they did not normally notice.
textDemand:It is hoped that the instruction of 0x01 0X11 ...
Posted by lyonsperf on Sun, 27 Jan 2019 10:21:14 -0800
[C++] Conversion Function
1. For the predefined basic data types of the system, C++ provides two types of type conversion: implicit type conversion and display type conversion.
int a=5,sum;
double b=5.55;
sum=a+b; //Implicit Type Conversion: The compiler first converts the value of a from int to double, and then adds it to b to get 10.55. When assig ...
Posted by audiodef on Sat, 26 Jan 2019 18:54:14 -0800
javah generates header files
Write native methods, such as:
package com.example.renzhenming.appmarket.ui.selectimage;
import android.graphics.Bitmap;
public class ImageUtil {
static {
System.loadLibrary("jpeg");
System.loadLibrary("compressimg");
}
/**
* Picture compression
* @param quality Quality of Compression
...
Posted by Cramblit on Thu, 24 Jan 2019 16:45:14 -0800