You are interested in which users are on the site at the same time. For example, you are given the following 5 users and their times: User 1- In: 1 Out: 4 User 2- In: 2 Out: 5 User 3- In: 7 Out: 8 User 4- In: 9 Out:10 User 5- In: 6 Out:10 This gives the distinct users that are on the site at the same time as (1,2), (4,5), and (3,5). Given n elements, write pseudocode for an algorithm that would take n^2 time to compute the number of pairs of users that are on the site at the same time
You are given n users, and their times that they log in and out of a website: You are interested in which users are on the site at the same time. For example, you are given the following 5 users and their times:
User 1- In: 1 Out: 4
User 2- In: 2 Out: 5
User 3- In: 7 Out: 8
User 4- In: 9 Out:10
User 5- In: 6 Out:10
This gives the distinct users that are on the site at the same time as (1,2), (4,5), and (3,5). Given n elements, write pseudocode for an
Trending now
This is a popular solution!
Step by step
Solved in 2 steps