• Breaking News

    Wednesday, September 1, 2021

    Emulating a CPU in software (plus a basic assembler) Computer Science

    Emulating a CPU in software (plus a basic assembler) Computer Science


    Emulating a CPU in software (plus a basic assembler)

    Posted: 31 Aug 2021 01:00 PM PDT

    Trying to understand Heap Sort complexity

    Posted: 01 Sep 2021 01:38 AM PDT

    I am trying to understand how heap sort works, and its complexity in general.

    a) From what I understand, fixHeap function is responsible for ensuring that the heap structure (max heap) is maintained. It does this by comparing a parent node against its children, and pick the largest of them to place it as the new parent node, essentially bubbling it downwards.

    Now, for each node, I understand in the worst case we will say it has to bubble down log n levels.

    And for every node, it will take n * log n. Essentially this is how many operations the heapify/fixheap function will take

    Is this right so far?

    b) With my understanding from a), I am having difficulties understanding the slides below.

    Why does heapyfing(left) and heapyfing(right) takes W((n-1)/2) each? How do they determine and simply it into heapfying left and right?

    From this code, there is no specific "left" and "right". The heapify just goes left or right depending which child node is larger than the parent node

    def heapify(arr, n, i): largest = i # Initialize largest as root l = 2 * i + 1 # left = 2*i + 1 r = 2 * i + 2 # right = 2*i + 2 # See if left child of root exists and is # greater than root if l < n and arr[largest] < arr[l]: largest = l # See if right child of root exists and is # greater than root if r < n and arr[largest] < arr[r]: largest = r # Change root, if needed if largest != i: arr[i], arr[largest] = arr[largest], arr[i] # swap # Heapify the root. heapify(arr, n, largest) 

    https://preview.redd.it/sg4i2pmkpuk71.png?width=1144&format=png&auto=webp&s=1eb0e1b5ae05e5e2ba04272006ceb762240c5c46

    https://preview.redd.it/vf8g2wynpuk71.png?width=1187&format=png&auto=webp&s=a934565597d3593cd754a8f7778441e81ee82b77

    https://preview.redd.it/ev7py10ppuk71.png?width=1133&format=png&auto=webp&s=f4aa36a2c5673a335130c76474bf95a02fdc9954

    https://preview.redd.it/vrduj69lquk71.png?width=1211&format=png&auto=webp&s=5db81163cd9546896c1a176c685c9be63e50284e

    submitted by /u/cocag13996
    [link] [comments]

    SDP ideas?

    Posted: 01 Sep 2021 03:07 AM PDT

    Hi , I'm an undergraduate computer engineer in my last year and I have to make a senior project. So any suggestions or ideas

    I'm comfortable with c++, python , javascript, web development, Arduino

    And am willing to learn anything

    submitted by /u/mohammedatef555
    [link] [comments]

    Need advice about participating research presentation

    Posted: 31 Aug 2021 11:00 PM PDT

    Hey so there's a summer research competition going on in my uni. I really wanted to participate and I just found out there's not much people who participated here. Anyway, so I really don't have anything at this moment with me but few days ago I created a mini algorithm. It's really simple and basic but I think it has some potential in game development and other educational stuffs. But it's not something really big. For example it's converting a array (maybe sorted or not) into a array where the indexes of the values are unpredictable. Something like this. Do you think I should get in the research presentation thing? I just need to know some opinion. Thanks in advance.

    submitted by /u/jsrafi
    [link] [comments]

    Timeline for Research internships.

    Posted: 31 Aug 2021 08:12 AM PDT

    I am an international high school graduate and I want to do a research internship in Human-computer interaction.
    Can I still get research opportunities in Ivy league universities in the Fall?

    Some say you only get in summer and some say you could get any time?

    Please help me with this.

    submitted by /u/Bivek7
    [link] [comments]

    What do you do for motivation?

    Posted: 31 Aug 2021 03:30 PM PDT

    What sort of books,movies,shows,documentaries,games,etc do you watch/consume for motivation to keep doing your job/ study well ? anything that helps reignite the passion for code/comp sci in general?

    submitted by /u/Vanilla_mice
    [link] [comments]

    No comments:

    Post a Comment