Data Structures and Algorithms

1. Span of Array

Problem Statement:
Find the span of an array (difference between maximum and minimum elements).

Example:
Input: [3, 4, 7, 10, 1]
Output: 9 (since 10 - 1 = 9)

Approach:

  • Initialize max = -∞ and min = +∞.

  • Traverse the array once.

    • Update max if current element > max.

    • Update min if current element < min.

  • Return max - min.

Time Complexity: O(n)
Space Complexity: O(1)



2. Second Largest Element

Problem Statement:
Find the second largest element in an array without sorting

...

See on Wikiteka »

Historia

Postacie:

Erazm z Rotterdamu – humanista, krytyk Kościoła, ale bez rozłamu.

Niccolò Machiavelli – autor Księcia, uważał, że władca ma być skuteczny, niekoniecznie moralny.

Mikołaj Kopernik – teoria heliocentryczna.

Marcin Luter – zapoczątkował reformację, 95 tez, luteranizm.

Jan Kalwin – kalwinizm (predestynacja).

Ignacy Loyola – założyciel jezuitów.

Henryk VIII – odłączył Anglię od papieża, anglikanizm.

Armand Richelieu – kardynał, wzmocnił władzę

...

See on Wikiteka »

lucrezio

In queste situazioni temo quello, che tu per caso pensi di introdurti nei principi empi di una dottrina e di intraprendere la strada del delitto. Al contrario troppo spesso quella superstizione ha dato luogo ad azioni scellerate ed empie. In questo modo in Aulide i capi scelti dei Danai, fior fiore degli eroi, macchiarono orribilmente l’altare della vergine Trivia con il sangue di Ifigenia. E non appena a costei la benda posta intorno alle chiome verginali scese da una parte e dall’altra delle

...

See on Wikiteka »

psych 110

  1. Syllabus Highlights & Course Intro

Definition and Nature of Learning    Learning: Enduring change in behavior mechanisms from experience. The Difference between Learning and Performance: Performance changes do not necessarily indicate learning; learning can occur without visible performance improvements.

Associative Learning: Forming associations between stimuli/events (CS-US) or behavior and outcomes (R-S). Learning can be conscious or unconscious (procedural/implicit learning). Learning...

See on Wikiteka »

law exam

Q1
The phrase "OSA to RTI revolution" refers to the significant shift from the Official Secrets Act (OSA) to the Right to Information (RTI) Act in India.

## Official Secrets Act (OSA)
- Restrictive: The OSA, enacted in 1923, was a colonial-era law that restricted access to information, emphasizing secrecy and confidentiality.
- Lack of Transparency: The OSA was criticized for promoting a culture of secrecy and limiting transparency in governance.

## Right to Information (RTI) Act
- Empowering Citizens:

...

See on Student Notes »

Biology

Part 5: Early Earth, Origin of Life, and Evolution
Characteristics of Early Earth & Prebiotic Simulation
Early Earth had no oxygen or ozone layer, high UV radiation, noxious gases, frequent electrical storms, and abundant water.
The prebiotic simulation (1950s) recreated early Earth conditions in the lab, resulting in the formation of amino acids—the basic building blocks of life. This supports the chemical evolution hypothesis.
Two main hypotheses for the origin of life:
Chemical evolution (prebiotic

...

See on Student Notes »

past 2 cheat sheet

TOPIC 7: INVESTMENT ANALYSIS II

Financial leverage is debt. “Unleveraged” FCF means we calculate FCF without regard to how the firm is financed. Ultimately we are valuing the assets of the project. We do this by estimating how much cash gets generated by the asset side of the balance sheet. 

Capital Expenditure (CAPEX) is defined as original cost of investment in property, plant or equipment and other long-term assets.

FORMULA FOR CAPEX:

NET PPE (current) - NET PPE (prior) + depreciation....

See on Wikiteka »

Hs zhabnaj

Role of SEBI: Meaning / Introduction: The Securities and Exchange Board of India (SEBI) is the regulator of the securities market in India. It was established to protect investor interests, regulate the market, and ensure transparency and fairness. Roles / Points: 1. Investor Protection: SEBI safeguards investors from unfair practices, frauds, and malpractices in the securities market. 2. Market Regulation: It regulates stock exchanges, brokers, and other intermediaries to ensure smooth functioning...

See on Student Notes »

accy 132 ethh

Case 1-2 — Giles & Regas (cheat-sheet paragraph): A romantic relationship between a supervising partner and an audit team member on the same engagement jeopardizes the audit and creates a conflict of interest with independence in appearance at risk. Label the threats: familiarity (primary), plus possible undue influence/self-interest; analyze with Virtue and Responsibilities/Duties lenses—virtue favors avoiding risky relationships at the outset. Apply the risk-based approach: identify/evaluate

...

See on Student Notes »